hledger/hledger/Hledger/Cli/Commands
Stephen Morgan c9eb7d1bcf lib,cli,ui: Separate costing from valuation; each can now be specified
independently.

You can now combine costing and valuation, for example "--cost
--value=then" will first convert to costs, and then value according to
the "--value=then" strategy. Any valuation strategy can be used with or
without costing.

If multiple valuation and costing strategies are specified on the
command line, then if any of them include costing
(-B/--cost/--value=cost) then amounts will be converted to cost, and for
valuation strategy the rightmost will be used.

--value=cost is deprecated, but still supported and is equivalent to
--cost/-B. --value=cost,COMM is no longer supported, but this behaviour can be
achieved with "--cost --value=then,COMM".
2021-01-28 13:57:48 -08:00
..
Check ;check: uniqueleafnames: short circuit to avoid wasted work 2021-01-09 18:59:10 -08:00
Accounts.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Accounts.md cli: drop deprecated command aliases a, b, p, r, txns 2020-12-26 08:21:45 -08:00
Accounts.txt ;update CLI usage texts 2020-12-26 08:21:45 -08:00
Activity.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Activity.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Activity.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Add.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Add.md add: fix help - arguments are inputs, not a query 2020-07-07 10:10:13 -07:00
Add.txt ;regen manuals 2020-07-07 10:19:56 -07:00
Aregister.hs areg: ignore a depth limit, as in 1.19 (#1468) 2021-01-24 09:46:12 -08:00
Aregister.md ;areg: doc: clarify account selection 2021-01-28 07:22:21 -08:00
Aregister.txt ;update CLI usage texts 2020-12-23 10:29:30 -08:00
Balance.hs lib,cli,ui: Separate costing from valuation; each can now be specified 2021-01-28 13:57:48 -08:00
Balance.md ;bal: doc: tweak 2021-01-10 15:50:49 -08:00
Balance.txt ;update CLI usage texts 2021-01-10 15:35:48 -08:00
Balancesheet.hs lib,cli: Use Text for CompoundPeriodicReport titles. 2021-01-02 15:08:09 +11:00
Balancesheet.md ;bs/bse/cf/is: describe in terms of balance command 2020-12-22 09:22:10 -08:00
Balancesheet.txt ;update CLI usage texts 2020-12-23 10:29:30 -08:00
Balancesheetequity.hs lib,cli: Use Text for CompoundPeriodicReport titles. 2021-01-02 15:08:09 +11:00
Balancesheetequity.md ;bs/bse/cf/is: describe in terms of balance command 2020-12-22 09:22:10 -08:00
Balancesheetequity.txt ;update CLI usage texts 2020-12-23 10:29:30 -08:00
Cashflow.hs lib,cli: Use Text for CompoundPeriodicReport titles. 2021-01-02 15:08:09 +11:00
Cashflow.md ;bs/bse/cf/is: describe in terms of balance command 2020-12-22 09:22:10 -08:00
Cashflow.txt ;update CLI usage texts 2020-12-23 10:29:30 -08:00
Check.hs ;check: accept parseable/autobalanced/assertions as arguments, for completeness 2021-01-05 16:25:43 -08:00
Check.md check: accept case-insensitive prefixes as arguments 2021-01-05 16:18:24 -08:00
Check.txt ;update CLI usage texts 2021-01-10 15:35:48 -08:00
Checkdates.hs lib,cli: Assorted fixes for older GHC. 2021-01-02 15:08:09 +11:00
Close.hs lib: Use Text and Text builder only in postingAsLines. 2021-01-02 15:08:09 +11:00
Close.md ;close: doc: cleanups, remove dangerous >> example (#1165) 2020-01-22 15:32:36 -08:00
Close.txt ;close: doc: cleanups, remove dangerous >> example (#1165) 2020-01-22 15:32:36 -08:00
Codes.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Codes.md codes: new command for listing transaction codes 2020-07-07 13:38:49 -07:00
Codes.txt codes: new command for listing transaction codes 2020-07-07 13:38:49 -07:00
commands.m4 cli: doc: sync/update manual & cli command lists 2020-12-23 10:28:31 -08:00
Commodities.hs Use nubSort instead of nub . sort. 2020-01-04 08:31:10 -08:00
Commodities.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Commodities.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Descriptions.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Descriptions.md descriptions, notes, payees: fix/improve help and comments 2020-07-07 13:38:49 -07:00
Descriptions.txt descriptions, notes, payees: fix/improve help and comments 2020-07-07 13:38:49 -07:00
Diff.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Diff.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Diff.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Files.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Files.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Files.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Help.hs cli/help: --info/--man/help show CMD/topic-specific docs 2020-12-26 17:27:28 -08:00
Help.md cli/help: --info/--man/help show CMD/topic-specific docs 2020-12-26 17:27:28 -08:00
Help.txt ;update CLI usage texts 2020-12-26 17:28:47 -08:00
Import.hs lib,cli: Make showTransaction return Text rather than String. 2021-01-02 15:08:09 +11:00
Import.md ;doc: link updates 2020-12-26 17:27:27 -08:00
Import.txt ;update CLI usage texts 2020-11-09 17:14:38 -08:00
Incomestatement.hs lib: Generalise CBCSubreportSpec to allow more subreport control. 2020-10-23 16:15:41 -07:00
Incomestatement.md ;bs/bse/cf/is: describe in terms of balance command 2020-12-22 09:22:10 -08:00
Incomestatement.txt ;update CLI usage texts 2020-12-23 10:29:30 -08:00
Notes.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Notes.md descriptions, notes, payees: fix/improve help and comments 2020-07-07 13:38:49 -07:00
Notes.txt descriptions, notes, payees: fix/improve help and comments 2020-07-07 13:38:49 -07:00
Payees.hs payees: add --used/--declared flags, like accounts 2021-01-17 16:37:38 -08:00
Payees.md payees: add --used/--declared flags, like accounts 2021-01-17 16:37:38 -08:00
Payees.txt descriptions, notes, payees: fix/improve help and comments 2020-07-07 13:38:49 -07:00
Prices.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Prices.md ;doc: link updates 2020-12-26 17:27:27 -08:00
Prices.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Print.hs lib,cli: Assorted fixes for older GHC. 2021-01-02 15:08:09 +11:00
Print.md ;print: cleanup; discuss unbalanced output (#1429) 2020-12-28 07:07:45 -08:00
Print.txt ;update CLI usage texts 2020-12-29 09:43:24 -08:00
Printunique.hs Use nubSort instead of nub . sort. 2020-01-04 08:31:10 -08:00
Printunique.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Printunique.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
README.md ;shake: commandtxts -> cmdhelp; note todos 2020-12-15 08:53:10 -08:00
Register.hs lib: Make sure to add a newline to the end of aregister report. 2021-01-10 20:50:46 -08:00
Register.md cli: drop deprecated command aliases a, b, p, r, txns 2020-12-26 08:21:45 -08:00
Register.txt ;update CLI usage texts 2020-12-26 08:21:45 -08:00
Registermatch.hs cli: Using Text Builder for posting reports. 2021-01-02 15:08:09 +11:00
Registermatch.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Registermatch.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Rewrite.hs lib,cli: Make showTransaction return Text rather than String. 2021-01-02 15:08:09 +11:00
Rewrite.md ;doc: commands: include in man pages again; simplify headings 2020-12-20 20:08:35 -08:00
Rewrite.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Roi.hs lib,cli,ui: Separate costing from valuation; each can now be specified 2021-01-28 13:57:48 -08:00
Roi.md roi: docs 2020-11-19 09:17:28 -08:00
Roi.txt ;update CLI usage texts 2020-11-19 09:19:12 -08:00
Stats.hs lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of 2020-10-23 14:14:11 -07:00
Stats.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Stats.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Tags.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Tags.md tags: add --parsed flag, hide empties without --empty 2020-07-14 10:20:52 -07:00
Tags.txt ;regen help, manuals 2020-07-14 10:25:04 -07:00
Test.md ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00
Test.txt ;doc: fix flags marker appearing in manuals 2020-01-05 07:41:01 -08:00

hledgers built-in commands.

Each command has a similarly-named code module, Somecommand.hs, and documentation file, Somecommand.md.

The command doc is converted to plain text in Somecommand.txt, and which is included by Somecommand.hs to form command line help (the output of hledger COMMAND --help).

After changing md files, regenerating and committing the txt files is optional. If you dont do it, it will get done later (before release). It can be done by:

./Shake cmdhelp

Or, by you can regenerate them while also building packages:

./Shake hledger   # or, all packages: ./Shake build

Builds made with stack, cabal, etc. wont notice changes in these md files, so use the above method if you need that.

The md files are also included by hledger/hledger_commands.m4.md to form the hledger manual, which can be regenerated with:

./Shake manuals [website]

Here are more special features/conventions of command doc files (see *.md for examples):

  • The content is pandoc markdown. m4 macros are not supported.

  • In manuals, they are rendered with formatting and hyperlinks when supported by the various output formats.

  • In command line help, they are rendered as plain text, with verbatim blocks unindented, and with lines longer than 78 characters wrapped (unless they contain no spaces).

  • To avoid unsightly line wrapping in command line help, try to keep verbatim examples to at most 78 characters wide. When necessary, we may be forced to cheat and alter command output slightly, eg reducing the width of registers typically 79-wide reports by one.

  • The first line should specify the command name and any aliases, as words separated by spaces and/or commas. It should end with a backslash (to force a line break in the output).

  • Short help, about one paragraph in length, should begin on the second line.

  • If the short help is more than one line, its first line should end with a single newline, not two (otherwise it will be displayed with two newlines after each line in command line help).

  • In command line help, the short help is displayed with blank lines removed (paragraphs run together). Blank lines can still be used for markdown formatting though, eg to define a list.

  • After the short help, there should be a paragraph containing just _FLAGS. This marks the end of the short help, and it will be replaced in command line help by the flags list. (Without it, the flags list appears at the end of command line help.) The flags list will not appear in the hledger manual.

  • Long help (as many paragraphs as needed) follows the _FLAGS marker. This often ends with one or more examples.

XXX Command docs with examples wider than 78: close rewrite