Safe Haskell | None |
---|
Command-line options for the hledger program, and option-parsing utilities.
- type RawOpts = [(String, String)]
- defmode :: Mode RawOpts
- mainmode :: [Name] -> Mode RawOpts
- convertmode :: Mode RawOpts
- addonmode :: Name -> Mode RawOpts
- help_postscript :: [a]
- generalflagstitle :: [Char]
- generalflags1 :: [Flag [([Char], [Char])]]
- generalflags2 :: [Flag [([Char], [Char])]]
- generalflags3 :: [Flag [([Char], [Char])]]
- fileflags :: [Flag [([Char], [Char])]]
- reportflags :: [Flag [([Char], [Char])]]
- helpflags :: [Flag [([Char], [Char])]]
- mainargsflag :: Arg [([Char], [Char])]
- commandargsflag :: Arg [([Char], [Char])]
- addonargsflag :: Arg [([Char], [Char])]
- commandmode :: [Name] -> Mode RawOpts
- addmode :: Mode RawOpts
- testmode :: Mode RawOpts
- accountsmode :: Mode RawOpts
- entriesmode :: Mode RawOpts
- postingsmode :: Mode RawOpts
- transactionsmode :: Mode RawOpts
- activitymode :: Mode RawOpts
- incomestatementmode :: Mode RawOpts
- balancesheetmode :: Mode RawOpts
- cashflowmode :: Mode RawOpts
- statsmode :: Mode RawOpts
- data CliOpts = CliOpts {}
- defcliopts :: CliOpts
- toCliOpts :: RawOpts -> IO CliOpts
- getHledgerCliOpts :: [String] -> IO CliOpts
- getHledgerAddonCommands :: IO [String]
- getHledgerProgramsInPath :: IO [String]
- getEnvSafe :: String -> IO String
- getDirectoryContentsSafe :: FilePath -> IO [FilePath]
- decodeRawOpts :: [(t, SystemString)] -> [(t, String)]
- rearrangeForCmdArgs :: [[Char]] -> [[Char]]
- optserror :: [Char] -> c
- setopt :: t -> [Char] -> [(t, [Char])] -> [(t, [Char])]
- setboolopt :: t -> [(t, [Char])] -> [(t, [Char])]
- in_ :: String -> RawOpts -> Bool
- boolopt :: String -> RawOpts -> Bool
- maybestringopt :: Eq a => a -> [(a, String)] -> Maybe String
- stringopt :: Eq a => a -> [(a, String)] -> [Char]
- listofstringopt :: Eq a => a -> [(a, t)] -> [t]
- maybeintopt :: String -> RawOpts -> Maybe Int
- intopt :: String -> RawOpts -> Int
- maybesmartdateopt :: Day -> String -> RawOpts -> Maybe Day
- maybedisplayopt :: Day -> RawOpts -> Maybe DisplayExp
- maybeperiodopt :: Day -> RawOpts -> Maybe (Interval, DateSpan)
- checkCliOpts :: CliOpts -> IO CliOpts
- formatFromOpts :: ReportOpts -> Either String [FormatString]
- defaultBalanceFormatString :: [FormatString]
- data OutputWidth
- = TotalWidth Width
- | FieldWidths [Width]
- data Width
- defaultWidth :: Int
- defaultWidthWithFlag :: Int
- widthFromOpts :: CliOpts -> Either String OutputWidth
- parseWidth :: String -> Either String OutputWidth
- outputwidth :: GenParser Char st OutputWidth
- width :: GenParser Char st Width
- journalFilePathFromOpts :: CliOpts -> IO String
- rulesFilePathFromOpts :: CliOpts -> IO (Maybe FilePath)
- aliasesFromOpts :: CliOpts -> [(AccountName, AccountName)]
- showModeHelp :: Mode a -> String
- tests_Hledger_Cli_Options :: Test
Documentation
help_postscript :: [a]Source
generalflags1 :: [Flag [([Char], [Char])]]Source
generalflags2 :: [Flag [([Char], [Char])]]Source
generalflags3 :: [Flag [([Char], [Char])]]Source
reportflags :: [Flag [([Char], [Char])]]Source
mainargsflag :: Arg [([Char], [Char])]Source
commandargsflag :: Arg [([Char], [Char])]Source
addonargsflag :: Arg [([Char], [Char])]Source
commandmode :: [Name] -> Mode RawOptsSource
toCliOpts :: RawOpts -> IO CliOptsSource
Parse raw option string values to the desired final data types. Any relative smart dates will be converted to fixed dates based on today's date. Parsing failures will raise an error.
getHledgerCliOpts :: [String] -> IO CliOptsSource
Get all command-line options, specifying any extra commands that are allowed, or fail on parse errors.
getHledgerAddonCommands :: IO [String]Source
Get the unique suffixes (without hledger-) of hledger-* executables found in the current user's PATH, or the empty list if there is any problem.
getHledgerProgramsInPath :: IO [String]Source
Get the unique names of hledger-* executables found in the current user's PATH, or the empty list if there is any problem.
getEnvSafe :: String -> IO StringSource
decodeRawOpts :: [(t, SystemString)] -> [(t, String)]Source
Convert possibly encoded option values to regular unicode strings.
rearrangeForCmdArgs :: [[Char]] -> [[Char]]Source
setboolopt :: t -> [(t, [Char])] -> [(t, [Char])]Source
listofstringopt :: Eq a => a -> [(a, t)] -> [t]Source
maybedisplayopt :: Day -> RawOpts -> Maybe DisplayExpSource
checkCliOpts :: CliOpts -> IO CliOptsSource
Do final validation of processed opts, raising an error if there is trouble.
formatFromOpts :: ReportOpts -> Either String [FormatString]Source
Parse the format option if provided, possibly returning an error, otherwise get the default value.
defaultBalanceFormatString :: [FormatString]Source
Default line format for balance report: %20(total) %2(depth_spacer)%-(account)
widthFromOpts :: CliOpts -> Either String OutputWidthSource
Parse the width option if provided, possibly returning an error, otherwise get the default value.
journalFilePathFromOpts :: CliOpts -> IO StringSource
Get the (tilde-expanded, absolute) journal file path from options, an environment variable, or a default.
rulesFilePathFromOpts :: CliOpts -> IO (Maybe FilePath)Source
Get the (tilde-expanded) rules file path from options, if any.
aliasesFromOpts :: CliOpts -> [(AccountName, AccountName)]Source
showModeHelp :: Mode a -> StringSource