mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 12:54:07 +03:00
lib: make output-file and output-format flags available separately
Kind of.. the output-file flag's help mentions output-format
This commit is contained in:
parent
f49756231a
commit
7204b1b9a1
@ -15,6 +15,8 @@ module Hledger.Cli.CliOptions (
|
||||
inputflags,
|
||||
reportflags,
|
||||
outputflags,
|
||||
outputFormatFlag,
|
||||
outputFileFlag,
|
||||
generalflagsgroup1,
|
||||
generalflagsgroup2,
|
||||
generalflagsgroup3,
|
||||
@ -149,10 +151,9 @@ reportflags = [
|
||||
]
|
||||
|
||||
-- | Common output-related flags: --output-file, --output-format...
|
||||
outputflags = [
|
||||
flagReq ["output-format","O"] (\s opts -> Right $ setopt "output-format" s opts) "FMT" "select the output format. Supported formats:\ntxt, csv."
|
||||
,flagReq ["output-file","o"] (\s opts -> Right $ setopt "output-file" s opts) "FILE" "write output to FILE. A file extension matching one of the above formats selects that format."
|
||||
]
|
||||
outputflags = [outputFormatFlag, outputFileFlag]
|
||||
outputFormatFlag = flagReq ["output-format","O"] (\s opts -> Right $ setopt "output-format" s opts) "FMT" "select the output format. Supported formats:\ntxt, csv."
|
||||
outputFileFlag = flagReq ["output-file","o"] (\s opts -> Right $ setopt "output-file" s opts) "FILE" "write output to FILE. A file extension matching one of the above formats selects that format."
|
||||
|
||||
argsFlag :: FlagHelp -> Arg RawOpts
|
||||
argsFlag desc = flagArg (\s opts -> Right $ setopt "args" s opts) desc
|
||||
|
Loading…
Reference in New Issue
Block a user