diff --git a/doc/lib.m4 b/doc/lib.m4 index d32894fd9..92aebb479 100644 --- a/doc/lib.m4 +++ b/doc/lib.m4 @@ -66,16 +66,16 @@ m4_dnl m4_define({{_helpoptions_}}, {{ `-h` -: show general usage (or after COMMAND, the command's usage) +: show general usage (or after COMMAND, command usage) `--help` -: show the current program's manual as plain text (or after an add-on COMMAND, the add-on's manual) +: show this program's manual as plain text (or after an add-on COMMAND, the add-on's manual) `--man` -: show the current program's manual with man +: show this program's manual with man `--info` -: show the current program's manual with info +: show this program's manual with info `--version` : show version diff --git a/hledger/Hledger/Cli/CliOptions.hs b/hledger/Hledger/Cli/CliOptions.hs index a4173fabd..6c9f9bec2 100644 --- a/hledger/Hledger/Cli/CliOptions.hs +++ b/hledger/Hledger/Cli/CliOptions.hs @@ -102,10 +102,10 @@ import Hledger.Cli.Version -- | Common help flags: --help, --debug, --version... helpflags :: [Flag RawOpts] helpflags = [ - flagNone ["h"] (setboolopt "h") "show general usage or (after CMD, the command's usage" - ,flagNone ["help"] (setboolopt "help") "show the current program's manual as plain text (or after an addon CMD, the add-on's manual)" - ,flagNone ["man"] (setboolopt "man") "show the current program's manual with man" - ,flagNone ["info"] (setboolopt "info") "show the current program's manual with info" + flagNone ["h"] (setboolopt "h") "show general usage (or after CMD, command usage)" + ,flagNone ["help"] (setboolopt "help") "show this program's manual as plain text (or after an addon CMD, the add-on's manual)" + ,flagNone ["man"] (setboolopt "man") "show this program's manual with man" + ,flagNone ["info"] (setboolopt "info") "show this program's manual with info" -- ,flagNone ["browse-args"] (setboolopt "browse-args") "use a web UI to select options and build up a command line" ,flagReq ["debug"] (\s opts -> Right $ setopt "debug" s opts) "[N]" "show debug output (levels 1-9, default: 1)" ,flagNone ["version"] (setboolopt "version") "show version information" diff --git a/hledger/Hledger/Cli/Print.hs b/hledger/Hledger/Cli/Print.hs index 0cb276a5f..e6af69705 100644 --- a/hledger/Hledger/Cli/Print.hs +++ b/hledger/Hledger/Cli/Print.hs @@ -28,7 +28,7 @@ import Hledger.Cli.Add ( transactionsSimilarTo ) printmode = (defCommandMode $ ["print"] ++ aliases) { - modeHelp = "show transaction entries" `withAliases` aliases + modeHelp = "show transaction journal entries" `withAliases` aliases ,modeGroupFlags = Group { groupUnnamed = [ let matcharg = "STR" diff --git a/hledger/doc/hledger.1.m4.md b/hledger/doc/hledger.1.m4.md index b1cd23ebb..e75a7d135 100644 --- a/hledger/doc/hledger.1.m4.md +++ b/hledger/doc/hledger.1.m4.md @@ -26,8 +26,9 @@ hledger - a command-line accounting tool # SYNOPSIS -`hledger [-f FILE] COMMAND [OPTIONS] [CMDARGS]`\ -`hledger [-f FILE] ADDONCMD -- [OPTIONS] [CMDARGS]` +`hledger [-f FILE] COMMAND [OPTIONS] [ARGS]`\ +`hledger [-f FILE] ADDONCMD -- [OPTIONS] [ARGS]`\ +`hledger` # DESCRIPTION @@ -67,9 +68,9 @@ changes existing transactions. To get started, you can either save some entries like the above in `~/.hledger.journal`, or run `hledger add` and follow the prompts. Then -try some commands like `hledger print` or `hledger balance`. See -COMMANDS and EXAMPLES below. - +try some commands like `hledger print` or `hledger balance`. +Run `hledger` with no arguments for a list of commands. + _include_(examples.m4.md) _include_(options.m4.md) _include_(queries.m4.md) diff --git a/hledger/doc/options.m4.md b/hledger/doc/options.m4.md index a04c74aba..1115410b4 100644 --- a/hledger/doc/options.m4.md +++ b/hledger/doc/options.m4.md @@ -1,19 +1,42 @@ # OPTIONS +## General options + To see general usage help, including general options which are supported by most hledger commands, run `hledger -h`. (Note -h and --help are different, like git.) -These options can appear anywhere on the command line, and are listed below. -To see usage for a specific command, run: `hledger COMMAND -h`. +General help options: + +_helpoptions_ + +General input options: + +_inputoptions_ + +General reporting options: + +_reportingoptions_ + +Note when multiple similar reporting options are provided, the last one takes precedence. +Eg `-p feb -p mar` is equivalent to `-p mar`. + +Some of these can also be written as [queries](#queries). + +## Command options + +To see options for a particular command, including command-specific options, run: `hledger COMMAND -h`. + Command-specific options must be written after the command name, eg: `hledger print -x`. -Additionally, if the command is an [add-on](#commands), +Additionally, if the command is an [addon](#commands), you may need to put its options after a double-hyphen, eg: `hledger ui -- --watch`. -Or, you can run the add-on executable directly, eg: `hledger-ui --watch`. +Or, you can run the addon executable directly: `hledger-ui --watch`. -Most commands also accept arguments, which are often -a [query](#queries) filtering the data in some way. +## Command arguments + +Most hledger commands accept arguments after the command name, +which are often a [query](#queries), filtering the data in some way. ## Special characters @@ -42,26 +65,6 @@ If in doubt, keep things simple: If you're really stumped, add `--debug=2` to troubleshoot. - -## General options - -### General help options - -_helpoptions_ - -### General input options - -_inputoptions_ - -### General reporting options - -_reportingoptions_ - -Note when multiple similar reporting options are provided, the last one takes precedence. -Eg `-p feb -p mar` is equivalent to `-p mar`. - -Some of these can also be written as [queries](#queries). - ## Input files hledger reads transactions from a data file (and the add command writes to it).