Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Fix help screen titles and change integration test identifier (#171)
Browse files Browse the repository at this point in the history
This PR implements minor cosmetic changes to the help screens and also changes the identifier when running as a process from test_with_process -> test-with-process
  • Loading branch information
sigalsax committed Feb 7, 2021
1 parent 0acf91b commit 2ba536b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions conjur/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 subcommands help:"
refer_to_help = "See more details in each subcommand's help:"
if subcommands:
res = ""
for subcommand in subcommands:
Expand Down Expand Up @@ -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]'
Expand All @@ -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')
Expand Down Expand Up @@ -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')

Expand All @@ -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 hosts 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',
Expand Down
2 changes: 1 addition & 1 deletion test/util/test_runners/test_runner_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ba536b

Please sign in to comment.