diff options
| author | Mike Frysinger <vapier@google.com> | 2021-07-26 23:46:32 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2021-07-28 05:38:34 +0000 |
| commit | 56345c345bdfdd71399d17ccd0ffe8f39bf720eb (patch) | |
| tree | efea7101c53e3f8eaea34639a54d8caedd8aa45a /man/repo.1 | |
| parent | a024bd33b808489acc909036b63697a819cc6ce7 (diff) | |
| download | git-repo-56345c345bdfdd71399d17ccd0ffe8f39bf720eb.tar.gz | |
repo: refactor help output handling
Currently we have the behavior:
* `repo`: Equivalent to `repo help` -- only shows common subcommands
(with short description), and then exits 0.
* `repo --help`: Shows repo's core options, lists all commands (no
specific info), and then exits 0.
The first case is not behaving well:
* If you run `repo` without a specific subcommand, that's an error,
so we should be exiting 1 instead.
* Showing only subcommands and no actual option summary makes it seem
like repo itself doesn't take any options. This confuses users.
Let's rework things a bit. Now we have the behavior:
* `repo`: Shows repo's core options, lists all commands (no specific
info), and then exits 1.
* `repo --help`: Shows repo's core options, shows common subcommands
(with short description), and then exits 0.
* `repo --help-all`: Shows repo's core options, shows all subcommands
(with short description), and then exits 0.
Basically we swap the behavior of `repo` and `repo --help`, and fix
the exit status when the subcommand is missing.
The addition of --help-all is mostly for the man pages. We were
relying on `repo help --all` to generate the repo(1) man page, but
that too omitted the core repo options. Now the man page includes
all the core repo options and provides a summary of all commands.
Change-Id: I1f99b99d5b8af2591f96a078d0647a3d76d6b0fc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312908
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'man/repo.1')
| -rw-r--r-- | man/repo.1 | 42 |
1 files changed, 39 insertions, 3 deletions
| @@ -2,9 +2,44 @@ | |||
| 2 | .TH REPO "1" "July 2021" "repo" "Repo Manual" | 2 | .TH REPO "1" "July 2021" "repo" "Repo Manual" |
| 3 | .SH NAME | 3 | .SH NAME |
| 4 | repo \- repository management tool built on top of git | 4 | repo \- repository management tool built on top of git |
| 5 | .SH DESCRIPTION | 5 | .SH SYNOPSIS |
| 6 | usage: repo COMMAND [ARGS] | 6 | .B repo |
| 7 | The complete list of recognized repo commands are: | 7 | [\fI\,-p|--paginate|--no-pager\/\fR] \fI\,COMMAND \/\fR[\fI\,ARGS\/\fR] |
| 8 | .SH OPTIONS | ||
| 9 | .TP | ||
| 10 | \fB\-h\fR, \fB\-\-help\fR | ||
| 11 | show this help message and exit | ||
| 12 | .TP | ||
| 13 | \fB\-\-help\-all\fR | ||
| 14 | show this help message with all subcommands and exit | ||
| 15 | .TP | ||
| 16 | \fB\-p\fR, \fB\-\-paginate\fR | ||
| 17 | display command output in the pager | ||
| 18 | .TP | ||
| 19 | \fB\-\-no\-pager\fR | ||
| 20 | disable the pager | ||
| 21 | .TP | ||
| 22 | \fB\-\-color\fR=\fI\,COLOR\/\fR | ||
| 23 | control color usage: auto, always, never | ||
| 24 | .TP | ||
| 25 | \fB\-\-trace\fR | ||
| 26 | trace git command execution (REPO_TRACE=1) | ||
| 27 | .TP | ||
| 28 | \fB\-\-trace\-python\fR | ||
| 29 | trace python command execution | ||
| 30 | .TP | ||
| 31 | \fB\-\-time\fR | ||
| 32 | time repo command execution | ||
| 33 | .TP | ||
| 34 | \fB\-\-version\fR | ||
| 35 | display this version of repo | ||
| 36 | .TP | ||
| 37 | \fB\-\-event\-log\fR=\fI\,EVENT_LOG\/\fR | ||
| 38 | filename of event log to append timeline to | ||
| 39 | .TP | ||
| 40 | \fB\-\-git\-trace2\-event\-log\fR=\fI\,GIT_TRACE2_EVENT_LOG\/\fR | ||
| 41 | directory to write git trace2 event log to | ||
| 42 | .SS "The complete list of recognized repo commands are:" | ||
| 8 | .TP | 43 | .TP |
| 9 | abandon | 44 | abandon |
| 10 | Permanently abandon a development branch | 45 | Permanently abandon a development branch |
| @@ -91,3 +126,4 @@ version | |||
| 91 | Display the version of repo | 126 | Display the version of repo |
| 92 | .PP | 127 | .PP |
| 93 | See 'repo help <command>' for more information on a specific command. | 128 | See 'repo help <command>' for more information on a specific command. |
| 129 | Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue | ||
