Improve help output

This commit is contained in:
TSR Berry 2023-10-10 16:59:25 +02:00
parent 9560921805
commit 223d642422
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2
4 changed files with 26 additions and 14 deletions

View file

@ -28,9 +28,9 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
subcommands: subcommands:
setup-git Set git identity to Ryujinx-Mako {setup-git,update-reviewers}
setup-git Configure git identity for Ryujinx-Mako
update-reviewers Update reviewers for the specified PR update-reviewers Update reviewers for the specified PR
``` ```
### setup-git ### setup-git
@ -38,11 +38,11 @@ subcommands:
``` ```
usage: ryujinx_mako setup-git [-h] [-l] usage: ryujinx_mako setup-git [-h] [-l]
Set git identity to Ryujinx-Mako Configure git identity for Ryujinx-Mako
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
-l, --local Set git identity only for the current repository. -l, --local configure the git identity only for the current repository
``` ```
### update-reviewers ### update-reviewers
@ -53,9 +53,9 @@ usage: ryujinx_mako update-reviewers [-h] repo_path pr_number config_path
Update reviewers for the specified PR Update reviewers for the specified PR
positional arguments: positional arguments:
repo_path repo_path full name of the GitHub repository (format: OWNER/REPO)
pr_number pr_number the number of the pull request to check
config_path config_path the path to the reviewers config file
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit

View file

@ -20,7 +20,7 @@ for subcommand in commands.SUBCOMMANDS:
subcommand_parser = subparsers.add_parser( subcommand_parser = subparsers.add_parser(
subcommand.name(), subcommand.name(),
description=subcommand.description(), description=subcommand.description(),
add_help=True, help=subcommand.description(),
) )
Subcommand.add_subcommand(subcommand.name(), subcommand(subcommand_parser)) Subcommand.add_subcommand(subcommand.name(), subcommand(subcommand_parser))
# Keep a reference to the subcommand # Keep a reference to the subcommand

View file

@ -12,14 +12,14 @@ class SetupGit(GithubSubcommand):
@staticmethod @staticmethod
def description() -> str: def description() -> str:
return f"Set git identity to {NAME}" return f"Configure git identity for {NAME}"
def __init__(self, parser: ArgumentParser): def __init__(self, parser: ArgumentParser):
parser.add_argument( parser.add_argument(
"-l", "-l",
"--local", "--local",
action="store_true", action="store_true",
help="Set git identity only for the current repository.", help="configure the git identity only for the current repository",
) )
super().__init__(parser) super().__init__(parser)

View file

@ -21,9 +21,21 @@ class UpdateReviewers(GithubSubcommand):
self._reviewers = set() self._reviewers = set()
self._team_reviewers = set() self._team_reviewers = set()
parser.add_argument("repo_path", type=str) parser.add_argument(
parser.add_argument("pr_number", type=int) "repo_path",
parser.add_argument("config_path", type=Path) type=str,
help="full name of the GitHub repository (format: OWNER/REPO)",
)
parser.add_argument(
"pr_number",
type=int,
help="the number of the pull request to check"
)
parser.add_argument(
"config_path",
type=Path,
help="the path to the reviewers config file",
)
super().__init__(parser) super().__init__(parser)