help: add -i/-m/-p short flags

This commit is contained in:
Simon Michael 2020-12-25 16:02:13 -08:00
parent 9beff54b27
commit 7d3f05b16a
2 changed files with 7 additions and 5 deletions

View File

@ -36,9 +36,9 @@ import Hledger.Cli.DocFiles
helpmode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Help.txt")
[flagNone ["info"] (setboolopt "info") "show the manual with info"
,flagNone ["man"] (setboolopt "man") "show the manual with man"
,flagNone ["pager"] (setboolopt "pager") "show the manual with $PAGER or less"
[flagNone ["info","i"] (setboolopt "info") "show the manual with info"
,flagNone ["man","m"] (setboolopt "man") "show the manual with man"
,flagNone ["pager","p"] (setboolopt "pager") "show the manual with $PAGER or less"
,flagNone ["help","h"] (setboolopt "help") "show this help"
]
[]

View File

@ -3,13 +3,15 @@ Show any of the hledger manuals.
_FLAGS
The `help` command displays any of the main [hledger user manuals](https://hledger.org/index.html), in one of several ways.
The `help` command displays any of the main [hledger user manuals](https://hledger.org/index.html),
in one of several ways.
Run it with no argument to list the manuals, or provide a full or partial manual name to select one.
hledger manuals are available in several formats.
hledger help will use the first of these display methods that it finds:
info, man, $PAGER, less, stdout (or when non-interactive, just stdout).
You can force a particular viewer with the `--info`, `--man`, `--pager` flags.
You can force a particular viewer with the `--info/-i`, `--man/-m`,
`--pager/-p` flags.
Examples: