cln: Display friendly error message if --pretty is given an incorrect
argument.
This commit is contained in:
parent
2b8190b238
commit
399d28dc05
@ -123,6 +123,7 @@ data ReportOpts = ReportOpts {
|
|||||||
,no_elide_ :: Bool
|
,no_elide_ :: Bool
|
||||||
,real_ :: Bool
|
,real_ :: Bool
|
||||||
,format_ :: StringFormat
|
,format_ :: StringFormat
|
||||||
|
,pretty_ :: Bool
|
||||||
,querystring_ :: [T.Text]
|
,querystring_ :: [T.Text]
|
||||||
--
|
--
|
||||||
,average_ :: Bool
|
,average_ :: Bool
|
||||||
@ -141,7 +142,6 @@ data ReportOpts = ReportOpts {
|
|||||||
,row_total_ :: Bool
|
,row_total_ :: Bool
|
||||||
,no_total_ :: Bool
|
,no_total_ :: Bool
|
||||||
,show_costs_ :: Bool -- ^ Whether to show costs for reports which normally don't show them
|
,show_costs_ :: Bool -- ^ Whether to show costs for reports which normally don't show them
|
||||||
,pretty_ :: Bool
|
|
||||||
,sort_amount_ :: Bool
|
,sort_amount_ :: Bool
|
||||||
,percent_ :: Bool
|
,percent_ :: Bool
|
||||||
,invert_ :: Bool -- ^ if true, flip all amount signs in reports
|
,invert_ :: Bool -- ^ if true, flip all amount signs in reports
|
||||||
@ -178,6 +178,7 @@ defreportopts = ReportOpts
|
|||||||
, no_elide_ = False
|
, no_elide_ = False
|
||||||
, real_ = False
|
, real_ = False
|
||||||
, format_ = def
|
, format_ = def
|
||||||
|
, pretty_ = False
|
||||||
, querystring_ = []
|
, querystring_ = []
|
||||||
, average_ = False
|
, average_ = False
|
||||||
, related_ = False
|
, related_ = False
|
||||||
@ -190,7 +191,6 @@ defreportopts = ReportOpts
|
|||||||
, row_total_ = False
|
, row_total_ = False
|
||||||
, no_total_ = False
|
, no_total_ = False
|
||||||
, show_costs_ = False
|
, show_costs_ = False
|
||||||
, pretty_ = False
|
|
||||||
, sort_amount_ = False
|
, sort_amount_ = False
|
||||||
, percent_ = False
|
, percent_ = False
|
||||||
, invert_ = False
|
, invert_ = False
|
||||||
@ -205,6 +205,7 @@ defreportopts = ReportOpts
|
|||||||
-- - an invalid --format argument,
|
-- - an invalid --format argument,
|
||||||
-- - an invalid --value argument,
|
-- - an invalid --value argument,
|
||||||
-- - if --valuechange is called with a valuation type other than -V/--value=end.
|
-- - if --valuechange is called with a valuation type other than -V/--value=end.
|
||||||
|
-- - an invalid --pretty argument,
|
||||||
rawOptsToReportOpts :: Day -> RawOpts -> ReportOpts
|
rawOptsToReportOpts :: Day -> RawOpts -> ReportOpts
|
||||||
rawOptsToReportOpts d rawopts =
|
rawOptsToReportOpts d rawopts =
|
||||||
|
|
||||||
@ -309,6 +310,7 @@ alwaysneveropt opt rawopts = case maybestringopt opt rawopts of
|
|||||||
Just "never" -> Just False
|
Just "never" -> Just False
|
||||||
Just "no" -> Just False
|
Just "no" -> Just False
|
||||||
Just "n" -> Just False
|
Just "n" -> Just False
|
||||||
|
Just _ -> usageError "argument to --pretty should be \"yes\" or \"no\""
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
balanceAccumulationOverride :: RawOpts -> Maybe BalanceAccumulation
|
balanceAccumulationOverride :: RawOpts -> Maybe BalanceAccumulation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user