From 7d0e605bc35ee4df9341c2244d00d97da09c5c05 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 29 May 2024 15:46:06 -1000 Subject: [PATCH] ;imp: cli: improve --debug's help --- hledger/Hledger/Cli/CliOptions.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hledger/Hledger/Cli/CliOptions.hs b/hledger/Hledger/Cli/CliOptions.hs index 7d54ee90e..15fbd4a7e 100644 --- a/hledger/Hledger/Cli/CliOptions.hs +++ b/hledger/Hledger/Cli/CliOptions.hs @@ -235,7 +235,11 @@ reportflags = [ ]) ,flagOpt "yes" ["pretty"] (\s opts -> Right $ setopt "pretty" s opts) "YN" "Use box-drawing characters in text output? Can be\n'yes' (the default argument for --pretty) or 'no'.\nIf YN is specified, the equals is required." - ,flagReq ["debug"] (\s opts -> Right $ setopt "debug" s opts) "[N]" "show debug output (levels 1-9, default: 1)" + + -- flagOpt would be more correct for --debug, showing --debug[=LVL] rather than --debug=[LVL]. + -- But because we handle --debug specially, flagReq also works, and it does not need =, removing a source of confusion. + -- ,flagOpt "1" ["debug"] (\s opts -> Right $ setopt "debug" s opts) "LVL" "show debug output (levels 1-9, default: 1)" + ,flagReq ["debug"] (\s opts -> Right $ setopt "debug" s opts) "[1-9]" "show this level of debug output (default: 1)" ] clihelpflags :: [Flag RawOpts]