hledger-1.14.2: Command-line interface for the hledger accounting tool

Safe HaskellNone



hledger's built-in commands, and helpers for printing the commands list.

New built-in commands should be added in four places below: the export list, the import list, builtinCommands, commandsList.



findCommand :: String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ()) Source #

Look up a builtin command's mode and action by exact command name or alias.

testcmd :: CliOpts -> Journal -> IO () Source #

The test command. Unlike most hledger commands, this one does not read the user's journal. A Journal argument remains in the type signature, but it should not be used (and would raise an error).

builtinCommands :: [(Mode RawOpts, CliOpts -> Journal -> IO ())] Source #

The cmdargs subcommand mode (for command-line parsing) and IO action (for doing the command's work) for each builtin command. Command actions take parsed CLI options and a (lazy) finalised journal.

builtinCommandNames :: [String] Source #

All names and aliases of builtin commands.

printCommandsList :: [String] -> IO () Source #

Print the commands list, modifying the template above based on the currently available addons. Missing addons will be removed, and extra addons will be added under Misc.