From 235018eca6b438c6078a00159cc21292c708972a Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Tue, 28 Apr 2020 16:11:06 -0600 Subject: [PATCH] cli: improve grant-permission --new --help message The --new option only creates a new permission if the permission does not already exist. Update the --help message to indicate this. --- cli/koji_cli/commands.py | 3 ++- tests/test_cli/test_grant_permission.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 01f75876..a56e9584 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2245,7 +2245,8 @@ def handle_grant_permission(goptions, session, args): "[admin] Grant a permission to a user" usage = _("usage: %prog grant-permission [--new] [ ...]") parser = OptionParser(usage=get_usage_str(usage)) - parser.add_option("--new", action="store_true", help=_("Create a new permission")) + parser.add_option("--new", action="store_true", + help=_("Create this permission if the permission does not exist")) (options, args) = parser.parse_args(args) if len(args) < 2: parser.error(_("Please specify a permission and at least one user")) diff --git a/tests/test_cli/test_grant_permission.py b/tests/test_cli/test_grant_permission.py index b468f00c..2cc82907 100644 --- a/tests/test_cli/test_grant_permission.py +++ b/tests/test_cli/test_grant_permission.py @@ -77,7 +77,7 @@ class TestGrantPermission(utils.CliTestCase): Options: -h, --help show this help message and exit - --new Create a new permission + --new Create this permission if the permission does not exist """ % self.progname)