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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hledger.Cli.Commands

Description

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.

Synopsis

- testcmd :: CliOpts -> Journal -> IO ()
- builtinCommands :: [(Mode RawOpts, CliOpts -> Journal -> IO ())]
- builtinCommandNames :: [String]
- findBuiltinCommand :: String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())
- knownAddonCommands :: [String]
- knownCommands :: [String]
- printCommandsList :: String -> [String] -> IO ()
- tests_Hledger_Cli :: TestTree
- module Hledger.Cli.Commands.Accounts
- module Hledger.Cli.Commands.Activity
- module Hledger.Cli.Commands.Add
- module Hledger.Cli.Commands.Aregister
- module Hledger.Cli.Commands.Balance
- module Hledger.Cli.Commands.Balancesheet
- module Hledger.Cli.Commands.Balancesheetequity
- module Hledger.Cli.Commands.Cashflow
- module Hledger.Cli.Commands.Close
- module Hledger.Cli.Commands.Codes
- module Hledger.Cli.Commands.Commodities
- module Hledger.Cli.Commands.Demo
- module Hledger.Cli.Commands.Descriptions
- module Hledger.Cli.Commands.Diff
- module Hledger.Cli.Commands.Help
- module Hledger.Cli.Commands.Import
- module Hledger.Cli.Commands.Incomestatement
- module Hledger.Cli.Commands.Notes
- module Hledger.Cli.Commands.Payees
- module Hledger.Cli.Commands.Prices
- module Hledger.Cli.Commands.Print
- module Hledger.Cli.Commands.Register
- module Hledger.Cli.Commands.Rewrite
- module Hledger.Cli.Commands.Stats
- module Hledger.Cli.Commands.Tags

# Documentation

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

The test command, which runs the hledger and hledger-lib packages' unit tests. This command also accepts tasty test runner options, written after a -- (double hyphen).

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 the builtin commands.

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

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

knownAddonCommands :: [String] Source #

Canonical names of the known addon commands which have a slot in the commands list, in alphabetical order.

knownCommands :: [String] Source #

Canonical names of all commands which have a slot in the commands list, in alphabetical order. These include the builtin commands and the known addon commands.

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

Print the commands list, with a pager if appropriate, customising the commandsList template above with the given version string and the installed addons. Uninstalled known addons will be removed from the list, installed known addons will have the + prefix removed, and installed unknown addons will be added under Misc.

tests_Hledger_Cli :: TestTree Source #

module Hledger.Cli.Commands.Accounts

module Hledger.Cli.Commands.Activity

module Hledger.Cli.Commands.Add

module Hledger.Cli.Commands.Aregister

module Hledger.Cli.Commands.Balance

module Hledger.Cli.Commands.Balancesheet

module Hledger.Cli.Commands.Balancesheetequity

module Hledger.Cli.Commands.Cashflow

module Hledger.Cli.Commands.Close

module Hledger.Cli.Commands.Codes

module Hledger.Cli.Commands.Commodities

module Hledger.Cli.Commands.Demo

module Hledger.Cli.Commands.Descriptions

module Hledger.Cli.Commands.Diff

module Hledger.Cli.Commands.Help

module Hledger.Cli.Commands.Import

module Hledger.Cli.Commands.Incomestatement

module Hledger.Cli.Commands.Notes

module Hledger.Cli.Commands.Payees

module Hledger.Cli.Commands.Prices

module Hledger.Cli.Commands.Print

module Hledger.Cli.Commands.Register

module Hledger.Cli.Commands.Rewrite

module Hledger.Cli.Commands.Stats

module Hledger.Cli.Commands.Tags