Hledger.Cli.Conf

hledger-1.41: Command-line interface for the hledger accounting system

Safe Haskell | None
Language | Haskell2010

Hledger.Cli.Conf

Description

Read extra CLI arguments from a hledger config file.

Synopsis

- getConf :: RawOpts -> IO (Conf, Maybe FilePath)
- confLookup :: SectionName -> Conf -> [Arg]

# Documentation

getConf :: RawOpts -> IO (Conf, Maybe FilePath) #

Try to read a hledger config from a config file specified by --conf, or the first config file found in any of several default file paths. If --no-conf was used, or if no file was specified or found, this returns a null Conf. If a specified file, or the first file found, can not be read or parsed, this raises an error. Otherwise this returns the parsed Conf, and the file path.

confLookup :: SectionName -> Conf -> [Arg] #

Fetch all the arguments/options defined in a section with this name, if it exists. This should be "general" for the unnamed first section, or a hledger command name.