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:
parent
9b67c6c892
commit
235018eca6
2 changed files with 3 additions and 2 deletions
|
|
@ -2245,7 +2245,8 @@ def handle_grant_permission(goptions, session, args):
|
||||||
"[admin] Grant a permission to a user"
|
"[admin] Grant a permission to a user"
|
||||||
usage = _("usage: %prog grant-permission [--new] <permission> <user> [<user> ...]")
|
usage = _("usage: %prog grant-permission [--new] <permission> <user> [<user> ...]")
|
||||||
parser = OptionParser(usage=get_usage_str(usage))
|
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)
|
(options, args) = parser.parse_args(args)
|
||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
parser.error(_("Please specify a permission and at least one user"))
|
parser.error(_("Please specify a permission and at least one user"))
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ class TestGrantPermission(utils.CliTestCase):
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help show this help message and exit
|
-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)
|
""" % self.progname)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue