From 867ea56ab4098b758cdbd34c28acc7ed14322212 Mon Sep 17 00:00:00 2001 From: sigalsax Date: Thu, 4 Feb 2021 14:23:11 +0200 Subject: [PATCH] Update flags according to UX --- conjur/cli.py | 23 +++++++++++++--------- test/util/test_runners/test_runner_args.py | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/conjur/cli.py b/conjur/cli.py index 67c74bd2..2ca3295c 100644 --- a/conjur/cli.py +++ b/conjur/cli.py @@ -81,7 +81,7 @@ def command_epilog(example, command=None, subcommands=None): """ This method builds the footer for each command help screen. """ - refer_to_help = "See more details in each subcommand’s help:" + refer_to_help = "See more details in each subcommand's help:" if subcommands: res = "" for subcommand in subcommands: @@ -295,11 +295,14 @@ def run(self, *args): usage=argparse.SUPPRESS, add_help=False, formatter_class=formatter_class) - replace_policy_parser.add_argument('-f', '--file', required=True, metavar='VALUE', + + replace_options = replace_policy_parser.add_argument_group(title=self.title("Options")) + + replace_options.add_argument('-f', '--file', required=True, metavar='VALUE', help='Provide policy file name') - replace_policy_parser.add_argument('-b', '--branch', required=True, metavar='VALUE', + replace_options.add_argument('-b', '--branch', required=True, metavar='VALUE', help='Provide the policy branch name') - replace_policy_parser.add_argument('-h', '--help', action='help', help='Display help screen and exit') + replace_options.add_argument('-h', '--help', action='help', help='Display help screen and exit') policy_update_name = 'update - Update existing resources in policy or create new resources' policy_update_usage = 'conjur [global options] policy update [options] [args]' @@ -311,11 +314,13 @@ def run(self, *args): usage=argparse.SUPPRESS, add_help=False, formatter_class=formatter_class) - update_policy_parser.add_argument('-f', '--file', required=True, metavar='VALUE', + replace_options = update_policy_parser.add_argument_group(title=self.title("Options")) + + replace_options.add_argument('-f', '--file', required=True, metavar='VALUE', help='Provide policy file name') - update_policy_parser.add_argument('-b', '--branch', required=True, metavar='VALUE', + replace_options.add_argument('-b', '--branch', required=True, metavar='VALUE', help='Provide the policy branch name') - update_policy_parser.add_argument('-h', '--help', action='help', help='Display help screen and exit') + replace_options.add_argument('-h', '--help', action='help', help='Display help screen and exit') policy_options = policy_subparser.add_argument_group(title=self.title("Options")) policy_options.add_argument('-h', '--help', action='help', help='Display help screen and exit') @@ -373,7 +378,7 @@ def run(self, *args): formatter_class=formatter_class) user_change_password_options = user_change_password.add_argument_group(title=self.title("Options")) - user_change_password_options.add_argument('-p', '--password', + user_change_password_options.add_argument('-p', '--password', metavar='VALUE', help='Provide the new password for the logged-in user') user_change_password_options.add_argument('-h', '--help', action='help', help='Display help screen and exit') @@ -394,7 +399,7 @@ def run(self, *args): add_help=False, formatter_class=formatter_class) host_subparsers = host_subparser.add_subparsers(dest='action', title=self.title("Subcommands")) - host_rotate_api_key_name = 'rotate-api-key - Rotate a host’s API key' + host_rotate_api_key_name = 'rotate-api-key - Rotate a host\'s API key' host_rotate_api_key_usage = 'conjur [global options] host rotate-api-key [options] [args]' host_rotate_api_key_parser = host_subparsers.add_parser('rotate-api-key', help='Rotate a host\'s API key', diff --git a/test/util/test_runners/test_runner_args.py b/test/util/test_runners/test_runner_args.py index 81e2933a..7b0a6d4e 100644 --- a/test/util/test_runners/test_runner_args.py +++ b/test/util/test_runners/test_runner_args.py @@ -30,7 +30,7 @@ def __init__(self, run_oss_tests, url, account, login, password, invoke_cli_as_p self.test_name_identifier = test_name_identifier # Tests if invoke_cli_as_process and test_name_identifier == 'integration': - self.test_name_identifier = "test_with_process" + self.test_name_identifier = "test-with-process" self.invoke_cli_as_process = invoke_cli_as_process self.cli_to_test = cli_to_test self.files_folder = files_folder