Sitelet https://github.com/craig5/aws-cli/commit/ac572167246eb90c366e9869025e0a5abf84ce96
Skip to content

Commit ac57216

Browse files
committed
Fix failing integ tests from aws#277
Also updated the usage strings to be consistent with the `<command> <subcommand>` changes.
1 parent ba83ae0 commit ac57216

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎awscli/argparser.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _build(self, command_table, version_string, argument_table):
7575

7676
class ServiceArgParser(CLIArgParser):
7777

78-
Usage = ("aws [options] <service_name> <operation> [parameters]")
78+
Usage = ("aws [options] <command> <subcommand> [parameters]")
7979

8080
def __init__(self, operations_table, service_name):
8181
super(ServiceArgParser, self).__init__(
@@ -92,7 +92,7 @@ def _build(self, operations_table):
9292

9393
class OperationArgParser(CLIArgParser):
9494
Formatter = argparse.RawTextHelpFormatter
95-
Usage = ("aws [options] <service_name> <operation> [parameters]")
95+
Usage = ("aws [options] <command> <subcommand> [parameters]")
9696

9797
type_map = {
9898
'structure': str,

‎tests/integration/test_cli.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_help_output(self):
5656
p = aws('help')
5757
self.assertEqual(p.rc, 1)
5858
self.assertIn('AWS', p.stdout)
59-
self.assertRegexpMatches(p.stdout, 'The\s+AWS\s+Command Line Interface')
59+
self.assertRegexpMatches(p.stdout, 'The\s+AWS\s+Command\s+Line\s+Interface')
6060

6161
def test_service_help_output(self):
6262
p = aws('ec2 help')
@@ -156,20 +156,20 @@ def test_make_requests_to_other_region(self):
156156

157157
def test_help_usage_top_level(self):
158158
p = aws('')
159-
self.assertIn('usage: aws [options] <service_name> '
160-
'<operation> [parameters]', p.stderr)
159+
self.assertIn('usage: aws [options] <command> '
160+
'<subcommand> [parameters]', p.stderr)
161161
self.assertIn('too few arguments', p.stderr)
162162

163163
def test_help_usage_service_level(self):
164164
p = aws('ec2')
165-
self.assertIn('usage: aws [options] <service_name> '
166-
'<operation> [parameters]', p.stderr)
165+
self.assertIn('usage: aws [options] <command> '
166+
'<subcommand> [parameters]', p.stderr)
167167
self.assertIn('too few arguments', p.stderr)
168168

169169
def test_help_usage_operation_level(self):
170170
p = aws('ec2 run-instances')
171-
self.assertIn('usage: aws [options] <service_name> '
172-
'<operation> [parameters]', p.stderr)
171+
self.assertIn('usage: aws [options] <command> '
172+
'<subcommand> [parameters]', p.stderr)
173173

174174
def test_unknown_argument(self):
175175
p = aws('ec2 describe-instances --filterss')

0 commit comments

Comments
 (0)