From a29564459bf0f5d9c8613b73b5e122d5de7eba93 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Sat, 24 Jun 2023 13:11:21 -0400 Subject: [PATCH] remove long-deprecated CLI flag aliases --- CHANGELOG.md | 7 +++++++ src/Job.hs | 28 ++-------------------------- test/warning/run.sh | 24 ------------------------ 3 files changed, 9 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac296c..a9db5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## Unreleased + +### Breaking Changes + +* Removed deprecated CLI flags `-d`/`-e`/`-i`, which have been aliased to + `-D`/`-E`/`-I` with a warning since late 2019 + ## v0.0.11 ### New Features diff --git a/src/Job.hs b/src/Job.hs index 02d984a..e764115 100644 --- a/src/Job.hs +++ b/src/Job.hs @@ -17,7 +17,6 @@ import qualified Paths_sv2v (version) import System.IO (stderr, hPutStr) import System.Console.CmdArgs import System.Directory (doesDirectoryExist) -import System.Environment (getArgs, withArgs) import System.Exit (exitFailure) data Exclude @@ -125,32 +124,9 @@ parseWrite w | otherwise = do matches :: String -> String -> Bool matches = isPrefixOf . map toLower -type DeprecationPhase = [String] -> IO [String] - -flagRename :: String -> String -> DeprecationPhase -flagRename before after strs = do - let strs' = map rename strs - if strs == strs' - then return strs - else do - hPutStr stderr $ "Deprecation warning: " ++ before ++ - " has been renamed to " ++ after ++ "\n" - return strs' - where - rename :: String -> String - rename arg = - if before == take (length before) arg - then after ++ drop (length before) arg - else arg - readJob :: IO Job -readJob = do - strs <- getArgs - strs' <- return strs - >>= flagRename "-i" "-I" - >>= flagRename "-d" "-D" - >>= flagRename "-e" "-E" - withArgs strs' $ cmdArgs defaultJob +readJob = + cmdArgs defaultJob >>= setWrite . setSuccinct setWrite :: Job -> IO Job diff --git a/test/warning/run.sh b/test/warning/run.sh index 90ddf03..1d34f33 100755 --- a/test/warning/run.sh +++ b/test/warning/run.sh @@ -4,9 +4,6 @@ NO_FILES_WARNING="Warning: No input files specified (try \`sv2v --help\`)" PACKAGE_WARNING="Warning: Source includes packages but no modules. Please convert packages alongside the modules that use them." INTERFACE_WARNING="Warning: Source includes an interface but output is empty because there is no top-level module which has no ports which are interfaces." PORT_CONN_ATTR_WARNING="attr.sv:6:11: Warning: Ignored port connection attributes (* foo *)(* bar *)." -DEPRECATED_D_WARNING="Deprecation warning: -d has been renamed to -D" -DEPRECATED_E_WARNING="Deprecation warning: -e has been renamed to -E" -DEPRECATED_I_WARNING="Deprecation warning: -i has been renamed to -I" test_default() { runAndCapture interface.sv module.sv package.sv @@ -71,27 +68,6 @@ test_only_localparam_verbose() { assertNull "stderr should be empty" "$stderr" } -test_deprecated_d() { - runAndCapture -d FOO -v localparam.sv - assertTrue "conversion should succeed" $result - assertNotNull "stdout should not be empty" "$stdout" - assertEquals "stderr should have warning" "$DEPRECATED_D_WARNING" "$stderr" -} - -test_deprecated_e() { - runAndCapture -e assert -v localparam.sv - assertTrue "conversion should succeed" $result - assertNotNull "stdout should not be empty" "$stdout" - assertEquals "stderr should have warning" "$DEPRECATED_E_WARNING" "$stderr" -} - -test_deprecated_i() { - runAndCapture -i. -v localparam.sv - assertTrue "conversion should succeed" $result - assertNotNull "stdout should not be empty" "$stdout" - assertEquals "stderr should have warning" "$DEPRECATED_I_WARNING" "$stderr" -} - source ../lib/functions.sh . shunit2