Skip to content

Commit 7048c1d

Browse files
committed
Capitalize "positional" and "optional" in help message
It looks better (IMO) and it’s also consistent with "Usage" that is already capitalized.
1 parent 8cc631a commit 7048c1d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ what we have now::
6363

6464
Greet somebody.
6565

66-
optional arguments:
66+
Optional arguments:
6767
-h, --help show this help message and exit
6868
-v, --verbose
6969
Be verbose

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ impl<'a, 'b> HelpFormatter<'a, 'b> {
897897
if self.parser.arguments.len() > 0
898898
|| self.parser.catchall_argument.is_some()
899899
{
900-
try!(write!(self.buf, "\npositional arguments:\n"));
900+
try!(write!(self.buf, "\nPositional arguments:\n"));
901901
for arg in self.parser.arguments.iter() {
902902
try!(self.print_argument(&**arg));
903903
}
@@ -911,7 +911,7 @@ impl<'a, 'b> HelpFormatter<'a, 'b> {
911911
if self.parser.short_options.len() > 0
912912
|| self.parser.long_options.len() > 0
913913
{
914-
try!(write!(self.buf, "\noptional arguments:\n"));
914+
try!(write!(self.buf, "\nOptional arguments:\n"));
915915
for opt in self.parser.options.iter() {
916916
try!(self.print_option(&**opt));
917917
}

src/test_help.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn test_empty() {
1414
+ "\n"
1515
+ "Test program\n"
1616
+ "\n"
17-
+ "optional arguments:\n"
17+
+ "Optional arguments:\n"
1818
+ " -h,--help show this help message and exit\n"
1919
, from_utf8(&buf[..]).unwrap().to_string());
2020
}
@@ -42,7 +42,7 @@ Test program. The description of the program is ought to be very long, because
4242
we want to test how word wrapping works for it. So some more text would be ok
4343
for the test\n"
4444
+ "\n"
45-
+ "optional arguments:\n"
45+
+ "Optional arguments:\n"
4646
+ " -h,--help show this help message and exit\n"
4747
+ " --value VALUE Set integer value\n"
4848
+ " -L,--long-option LONG_OPTION\n"
@@ -65,10 +65,10 @@ fn test_argument() {
6565
+ "\n"
6666
+ "Test program\n"
6767
+ "\n"
68-
+ "positional arguments:\n"
68+
+ "Positional arguments:\n"
6969
+ " value Integer value\n"
7070
+ "\n"
71-
+ "optional arguments:\n"
71+
+ "Optional arguments:\n"
7272
+ " -h,--help show this help message and exit\n"
7373
, from_utf8(&buf[..]).unwrap().to_string());
7474
}
@@ -92,11 +92,11 @@ fn test_arguments() {
9292
+ "\n"
9393
+ "Test program\n"
9494
+ "\n"
95-
+ "positional arguments:\n"
95+
+ "Positional arguments:\n"
9696
+ " v1 Integer value 1\n"
9797
+ " v2 More values\n"
9898
+ "\n"
99-
+ "optional arguments:\n"
99+
+ "Optional arguments:\n"
100100
+ " -h,--help show this help message and exit\n"
101101
, from_utf8(&buf[..]).unwrap().to_string());
102102
}
@@ -122,11 +122,11 @@ fn test_req_arguments() {
122122
+ "\n"
123123
+ "Test program\n"
124124
+ "\n"
125-
+ "positional arguments:\n"
125+
+ "Positional arguments:\n"
126126
+ " v1 Integer value 1\n"
127127
+ " v2 More values\n"
128128
+ "\n"
129-
+ "optional arguments:\n"
129+
+ "Optional arguments:\n"
130130
+ " -h,--help show this help message and exit\n"
131131
, from_utf8(&buf[..]).unwrap().to_string());
132132
}
@@ -147,7 +147,7 @@ fn test_metavar() {
147147
+ "\n"
148148
+ "Test program.\n"
149149
+ "\n"
150-
+ "optional arguments:\n"
150+
+ "Optional arguments:\n"
151151
+ " -h,--help show this help message and exit\n"
152152
+ " -L,--long-option VAL Long option value\n"
153153
, from_utf8(&buf[..]).unwrap().to_string());

0 commit comments

Comments
 (0)