Neither hbal nor hn1 take any arguments beside the options, so if any
are passed is most likely an unintended error. This patch aborts in such
cases.
main :: IO ()
main = do
cmd_args <- System.getArgs
- (opts, _) <- CLI.parseOpts cmd_args "hbal" options defaultOptions optShowHelp
+ (opts, args) <- CLI.parseOpts cmd_args "hbal" options
+ defaultOptions optShowHelp
+
+ unless (null args) $ do
+ hPutStrLn stderr "Error: this program doesn't take any arguments."
+ exitWith $ ExitFailure 1
when (optShowVer opts) $ do
putStr $ CLI.showVersion "hbal"
main :: IO ()
main = do
cmd_args <- System.getArgs
- (opts, _) <- CLI.parseOpts cmd_args "hn1" options defaultOptions optShowHelp
+ (opts, args) <- CLI.parseOpts cmd_args "hn1" options
+ defaultOptions optShowHelp
+
+ unless (null args) $ do
+ hPutStrLn stderr "Error: this program doesn't take any arguments."
+ exitWith $ ExitFailure 1
when (optShowVer opts) $ do
printf $ CLI.showVersion "hn1"