hledger-0.12: A command-line (or curses or web-based) double-entry accounting tool.



Command-line options for the application.



options :: [OptDescr Opt]Source

Command-line options we accept.

data Opt Source

An option value from a command-line flag.


parseArguments :: IO ([Opt], String, [String])Source

Parse the command-line arguments into options, command name, and command arguments. Any dates in the options are converted to explicit YYYYMMDD format based on the current time.

fixOptDates :: [Opt] -> IO [Opt]Source

Convert any fuzzy dates within these option values to explicit ones, based on today's date.

dateSpanFromOpts :: Day -> [Opt] -> DateSpanSource

Figure out the overall date span we should report on, based on any beginendperiod options provided. If there is a period option, the others are ignored.

intervalFromOpts :: [Opt] -> IntervalSource

Figure out the reporting interval, if any, specified by the options. If there is a period option, the others are ignored.

depthFromOpts :: [Opt] -> Maybe IntSource

Get the value of the (last) depth option, if any.

dropFromOpts :: [Opt] -> IntSource

Get the value of the (last) drop option, if any, otherwise 0.

displayExprFromOpts :: [Opt] -> Maybe StringSource

Get the value of the (last) display option, if any.

baseUrlFromOpts :: [Opt] -> Maybe StringSource

Get the value of the (last) baseurl option, if any.

portFromOpts :: [Opt] -> Maybe IntSource

Get the value of the (last) port option, if any.

usingTimeProgramName :: IO BoolSource

Get a maybe boolean representing the last cleared/uncleared option if any.

Were we invoked as "hours" ?

journalFilePathFromOpts :: [Opt] -> IO StringSource

Get the journal file path from options, an environment variable, or a default

parsePatternArgs :: [String] -> ([String], [String])Source

Gather filter pattern arguments into a list of account patterns and a list of description patterns. We interpret pattern arguments as follows: those prefixed with desc: are description patterns, all others are account patterns; also patterns prefixed with not: are negated. not: should come after desc: if both are used.

optsToFilterSpec :: [Opt] -> [String] -> LocalTime -> FilterSpecSource

Convert application options to the library's generic filter specification.