hledger-0.18.2: The main command-line interface for the hledger accounting tool.

Safe HaskellNone

Hledger.Cli.Options

Description

Command-line options for the hledger program, and option-parsing utilities.

Synopsis

Documentation

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.

decodeRawOpts :: [(t, SystemString)] -> [(t, String)]Source

Convert possibly encoded option values to regular unicode strings.

setopt :: t -> [Char] -> [(t, [Char])] -> [(t, [Char])]Source

setboolopt :: t -> [(t, [Char])] -> [(t, [Char])]Source

maybestringopt :: Eq a => a -> [(a, String)] -> Maybe StringSource

stringopt :: Eq a => a -> [(a, String)] -> [Char]Source

listofstringopt :: Eq a => a -> [(a, t)] -> [t]Source

checkCliOpts :: CliOpts -> IO CliOptsSource

Do final validation of processed opts, raising an error if there is trouble.

formatFromOpts :: ReportOpts -> Either String [FormatString]Source

Parse any format option provided, possibly raising an error, or 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.