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.
This commit is contained in:
Ken Dreyer 2020-04-28 16:11:06 -06:00 committed by Tomas Kopecek
parent 9b67c6c892
commit 235018eca6
2 changed files with 3 additions and 2 deletions

View file

@ -2245,7 +2245,8 @@ def handle_grant_permission(goptions, session, args):
"[admin] Grant a permission to a user"
usage = _("usage: %prog grant-permission [--new] <permission> <user> [<user> ...]")
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"))

View file

@ -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)