From 56345c345bdfdd71399d17ccd0ffe8f39bf720eb Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 26 Jul 2021 23:46:32 -0400 Subject: 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 Tested-by: Mike Frysinger --- man/repo-manifest.1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'man/repo-manifest.1') diff --git a/man/repo-manifest.1 b/man/repo-manifest.1 index e42cc42e..be467607 100644 --- a/man/repo-manifest.1 +++ b/man/repo-manifest.1 @@ -36,6 +36,9 @@ output manifest in JSON format (experimental) \fB\-\-pretty\fR format output for humans to read .TP +\fB\-\-no\-local\-manifests\fR +ignore local manifests +.TP \fB\-o\fR \-|NAME.xml, \fB\-\-output\-file\fR=\fI\,\-\/\fR|NAME.xml file to save the manifest to .SS Logging options: @@ -95,7 +98,7 @@ include*)> .IP .IP - + @@ -393,13 +396,13 @@ Same syntax as the corresponding element of `project`. .PP Element annotation .PP -Zero or more annotation elements may be specified as children of a project -element. Each element describes a name\-value pair that will be exported into -each project's environment during a 'forall' command, prefixed with REPO__. In -addition, there is an optional attribute "keep" which accepts the case -insensitive values "true" (default) or "false". This attribute determines -whether or not the annotation will be kept when exported with the manifest -subcommand. +Zero or more annotation elements may be specified as children of a project or +remote element. Each element describes a name\-value pair. For projects, this +name\-value pair will be exported into each project's environment during a +\&'forall' command, prefixed with `REPO__`. In addition, there is an optional +attribute "keep" which accepts the case insensitive values "true" (default) or +"false". This attribute determines whether or not the annotation will be kept +when exported with the manifest subcommand. .PP Element copyfile .PP -- cgit v1.2.3-54-g00ecf