Skip to content

Commit 7659317

Browse files
committed
fix: update argument categorization logic to match ArgumentParser standard help output
1 parent ad95073 commit 7659317

11 files changed

+127
-125
lines changed

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testColorDoccReference().md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
color --fav=<fav> [--second=<second>] [--help]
77
```
88

9-
### Flags
10-
11-
- term **--help:**
12-
13-
*Show help information.*
14-
15-
169
### Options
1710

1811
- term **--fav=\<fav\>:**
@@ -27,6 +20,11 @@ color --fav=<fav> [--second=<second>] [--help]
2720
This is optional.
2821

2922

23+
- term **--help:**
24+
25+
*Show help information.*
26+
27+
3028
## color.help
3129

3230
Show subcommand help information.
@@ -38,3 +36,5 @@ color help [<subcommands>...]
3836
### Arguments
3937

4038
- term **subcommands:**
39+
40+
*The subcommand(s) you want help for.*

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testColorMarkdownReference().md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
color --fav=<fav> [--second=<second>] [--help]
77
```
88

9-
### Flags
10-
11-
**--help:**
12-
13-
*Show help information.*
14-
15-
169
### Options
1710

1811
**--fav=\<fav\>:**
@@ -27,6 +20,11 @@ color --fav=<fav> [--second=<second>] [--help]
2720
This is optional.
2821

2922

23+
**--help:**
24+
25+
*Show help information.*
26+
27+
3028
## color.help
3129

3230
Show subcommand help information.
@@ -38,3 +36,5 @@ color help [<subcommands>...]
3836
### Arguments
3937

4038
**subcommands:**
39+
40+
*The subcommand(s) you want help for.*

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testCountLinesDoccReference().md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ count-lines [<input-file>] [--prefix=<prefix>] [--verbose] [--help]
1313
*A file to count lines in. If omitted, counts the lines of stdin.*
1414

1515

16-
### Flags
16+
### Options
17+
18+
- term **--prefix=\<prefix\>:**
19+
20+
*Only count lines with this prefix.*
21+
1722

1823
- term **--verbose:**
1924

@@ -25,13 +30,6 @@ count-lines [<input-file>] [--prefix=<prefix>] [--verbose] [--help]
2530
*Show help information.*
2631

2732

28-
### Options
29-
30-
- term **--prefix=\<prefix\>:**
31-
32-
*Only count lines with this prefix.*
33-
34-
3533
## count-lines.help
3634

3735
Show subcommand help information.
@@ -43,3 +41,5 @@ count-lines help [<subcommands>...]
4341
### Arguments
4442

4543
- term **subcommands:**
44+
45+
*The subcommand(s) you want help for.*

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testCountLinesMarkdownReference().md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ count-lines [<input-file>] [--prefix=<prefix>] [--verbose] [--help]
1313
*A file to count lines in. If omitted, counts the lines of stdin.*
1414

1515

16-
### Flags
16+
### Options
17+
18+
**--prefix=\<prefix\>:**
19+
20+
*Only count lines with this prefix.*
21+
1722

1823
**--verbose:**
1924

@@ -25,13 +30,6 @@ count-lines [<input-file>] [--prefix=<prefix>] [--verbose] [--help]
2530
*Show help information.*
2631

2732

28-
### Options
29-
30-
**--prefix=\<prefix\>:**
31-
32-
*Only count lines with this prefix.*
33-
34-
3533
## count-lines.help
3634

3735
Show subcommand help information.
@@ -43,3 +41,5 @@ count-lines help [<subcommands>...]
4341
### Arguments
4442

4543
**subcommands:**
44+
45+
*The subcommand(s) you want help for.*

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testMathDoccReference().md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A utility for performing maths.
88
math [--version] [--help]
99
```
1010

11-
### Flags
11+
### Options
1212

1313
- term **--version:**
1414

@@ -35,7 +35,7 @@ math add [--hex-output] [<values>...] [--version] [--help]
3535
*A group of integers to operate on.*
3636

3737

38-
### Flags
38+
### Options
3939

4040
- term **--hex-output:**
4141

@@ -66,7 +66,7 @@ math multiply [--hex-output] [<values>...] [--version] [--help]
6666
*A group of integers to operate on.*
6767

6868

69-
### Flags
69+
### Options
7070

7171
- term **--hex-output:**
7272

@@ -90,7 +90,7 @@ Calculate descriptive statistics.
9090
math stats [--version] [--help]
9191
```
9292

93-
### Flags
93+
### Options
9494

9595
- term **--version:**
9696

@@ -117,7 +117,12 @@ math stats average [--kind=<kind>] [<values>...] [--version] [--help]
117117
*A group of floating-point values to operate on.*
118118

119119

120-
### Flags
120+
### Options
121+
122+
- term **--kind=\<kind\>:**
123+
124+
*The kind of average to provide.*
125+
121126

122127
- term **--version:**
123128

@@ -128,13 +133,6 @@ math stats average [--kind=<kind>] [<values>...] [--version] [--help]
128133

129134
*Show help information.*
130135

131-
132-
### Options
133-
134-
- term **--kind=\<kind\>:**
135-
136-
*The kind of average to provide.*
137-
138136
### math.stats.stdev
139137

140138
Print the standard deviation of the values.
@@ -150,7 +148,7 @@ math stats stdev [<values>...] [--version] [--help]
150148
*A group of floating-point values to operate on.*
151149

152150

153-
### Flags
151+
### Options
154152

155153
- term **--version:**
156154

@@ -185,18 +183,6 @@ math stats quantiles [<one-of-four>] [<custom-arg>] [<custom-deprecated-arg>] [<
185183
*A group of floating-point values to operate on.*
186184

187185

188-
### Flags
189-
190-
- term **--version:**
191-
192-
*Show the version.*
193-
194-
195-
- term **--help:**
196-
197-
*Show help information.*
198-
199-
200186
### Options
201187

202188
- term **--file=\<file\>:**
@@ -213,6 +199,16 @@ math stats quantiles [<one-of-four>] [<custom-arg>] [<custom-deprecated-arg>] [<
213199

214200
- term **--custom-deprecated=\<custom-deprecated\>:**
215201

202+
203+
- term **--version:**
204+
205+
*Show the version.*
206+
207+
208+
- term **--help:**
209+
210+
*Show help information.*
211+
216212
## math.help
217213

218214
Show subcommand help information.
@@ -225,8 +221,10 @@ math help [<subcommands>...] [--version]
225221

226222
- term **subcommands:**
227223

224+
*The subcommand(s) you want help for.*
228225

229-
### Flags
226+
227+
### Options
230228

231229
- term **--version:**
232230

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testMathMarkdownReference().md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A utility for performing maths.
88
math [--version] [--help]
99
```
1010

11-
### Flags
11+
### Options
1212

1313
**--version:**
1414

@@ -35,7 +35,7 @@ math add [--hex-output] [<values>...] [--version] [--help]
3535
*A group of integers to operate on.*
3636

3737

38-
### Flags
38+
### Options
3939

4040
**--hex-output:**
4141

@@ -66,7 +66,7 @@ math multiply [--hex-output] [<values>...] [--version] [--help]
6666
*A group of integers to operate on.*
6767

6868

69-
### Flags
69+
### Options
7070

7171
**--hex-output:**
7272

@@ -90,7 +90,7 @@ Calculate descriptive statistics.
9090
math stats [--version] [--help]
9191
```
9292

93-
### Flags
93+
### Options
9494

9595
**--version:**
9696

@@ -117,7 +117,12 @@ math stats average [--kind=<kind>] [<values>...] [--version] [--help]
117117
*A group of floating-point values to operate on.*
118118

119119

120-
### Flags
120+
### Options
121+
122+
**--kind=\<kind\>:**
123+
124+
*The kind of average to provide.*
125+
121126

122127
**--version:**
123128

@@ -128,13 +133,6 @@ math stats average [--kind=<kind>] [<values>...] [--version] [--help]
128133

129134
*Show help information.*
130135

131-
132-
### Options
133-
134-
**--kind=\<kind\>:**
135-
136-
*The kind of average to provide.*
137-
138136
### math.stats.stdev
139137

140138
Print the standard deviation of the values.
@@ -150,7 +148,7 @@ math stats stdev [<values>...] [--version] [--help]
150148
*A group of floating-point values to operate on.*
151149

152150

153-
### Flags
151+
### Options
154152

155153
**--version:**
156154

@@ -185,18 +183,6 @@ math stats quantiles [<one-of-four>] [<custom-arg>] [<custom-deprecated-arg>] [<
185183
*A group of floating-point values to operate on.*
186184

187185

188-
### Flags
189-
190-
**--version:**
191-
192-
*Show the version.*
193-
194-
195-
**--help:**
196-
197-
*Show help information.*
198-
199-
200186
### Options
201187

202188
**--file=\<file\>:**
@@ -213,6 +199,16 @@ math stats quantiles [<one-of-four>] [<custom-arg>] [<custom-deprecated-arg>] [<
213199

214200
**--custom-deprecated=\<custom-deprecated\>:**
215201

202+
203+
**--version:**
204+
205+
*Show the version.*
206+
207+
208+
**--help:**
209+
210+
*Show help information.*
211+
216212
## math.help
217213

218214
Show subcommand help information.
@@ -225,8 +221,10 @@ math help [<subcommands>...] [--version]
225221

226222
**subcommands:**
227223

224+
*The subcommand(s) you want help for.*
228225

229-
### Flags
226+
227+
### Options
230228

231229
**--version:**
232230

0 commit comments

Comments
 (0)