1
0
Fork 0

subcmds: force consistent help text format

We're inconsistent with help text as to whether it uses title case and
whether it ends in a period.  Add a test to enforce a standard, and use
the style that Python optparse & argparse use themselves (e.g. with the
--help option): always lowercase, and never trailing period.

Change-Id: Ic1defae23daeac0ac9116aaf487427f50b34050d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305144
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2021-05-04 08:06:36 -04:00
parent aedd1e5ef0
commit c177f944d9
12 changed files with 91 additions and 60 deletions

View file

@ -36,22 +36,22 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
def _Options(self, p):
p.add_option('-r', '--regex',
dest='regex', action='store_true',
help="Filter the project list based on regex or wildcard matching of strings")
help='filter the project list based on regex or wildcard matching of strings')
p.add_option('-g', '--groups',
dest='groups',
help="Filter the project list based on the groups the project is in")
help='filter the project list based on the groups the project is in')
p.add_option('-a', '--all',
action='store_true',
help='Show projects regardless of checkout state')
help='show projects regardless of checkout state')
p.add_option('-f', '--fullpath',
dest='fullpath', action='store_true',
help="Display the full work tree path instead of the relative path")
help='display the full work tree path instead of the relative path')
p.add_option('-n', '--name-only',
dest='name_only', action='store_true',
help="Display only the name of the repository")
help='display only the name of the repository')
p.add_option('-p', '--path-only',
dest='path_only', action='store_true',
help="Display only the path of the repository")
help='display only the path of the repository')
def ValidateOptions(self, opt, args):
if opt.fullpath and opt.name_only: