File tree 3 files changed +17
-2
lines changed
Tests/ArgumentParserGenerateManualTests
Tools/generate-manual/DSL
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ final class MathGenerateManualTests: XCTestCase {
35
35
.It Fl h , -help
36
36
Show help information.
37
37
.It Em add
38
+ Print the sum of the values.
38
39
.Bl -tag -width 6n
39
40
.It Fl x , -hex-output
40
41
Use hexadecimal notation for the result.
@@ -46,6 +47,7 @@ final class MathGenerateManualTests: XCTestCase {
46
47
Show help information.
47
48
.El
48
49
.It Em multiply
50
+ Print the product of the values.
49
51
.Bl -tag -width 6n
50
52
.It Fl x , -hex-output
51
53
Use hexadecimal notation for the result.
@@ -57,12 +59,14 @@ final class MathGenerateManualTests: XCTestCase {
57
59
Show help information.
58
60
.El
59
61
.It Em stats
62
+ Calculate descriptive statistics.
60
63
.Bl -tag -width 6n
61
64
.It Fl -version
62
65
Show the version.
63
66
.It Fl h , -help
64
67
Show help information.
65
68
.It Em average
69
+ Print the average of the values.
66
70
.Bl -tag -width 6n
67
71
.It Fl -kind Ar kind
68
72
The kind of average to provide.
@@ -74,6 +78,7 @@ final class MathGenerateManualTests: XCTestCase {
74
78
Show help information.
75
79
.El
76
80
.It Em stdev
81
+ Print the standard deviation of the values.
77
82
.Bl -tag -width 6n
78
83
.It Ar values...
79
84
A group of floating-point values to operate on.
@@ -83,6 +88,7 @@ final class MathGenerateManualTests: XCTestCase {
83
88
Show help information.
84
89
.El
85
90
.It Em quantiles
91
+ Print the quantiles of the values (TBD).
86
92
.Bl -tag -width 6n
87
93
.It Ar one-of-four
88
94
.It Ar custom-arg
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ struct Document: MDocComponent {
27
27
if multiPage {
28
28
MultiPageDescription ( command: command)
29
29
} else {
30
- SinglePageDescription ( command: command)
30
+ SinglePageDescription ( command: command, root : true )
31
31
}
32
32
Exit ( section: section)
33
33
if multiPage {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import ArgumentParserToolInfo
14
14
15
15
struct SinglePageDescription : MDocComponent {
16
16
var command : CommandInfoV0
17
+ var root : Bool
17
18
18
19
var body : MDocComponent {
19
20
Section ( title: " description " ) {
@@ -23,6 +24,14 @@ struct SinglePageDescription: MDocComponent {
23
24
24
25
@MDocBuilder
25
26
var core : MDocComponent {
27
+ if !root, let abstract = command. abstract {
28
+ abstract
29
+ }
30
+
31
+ if !root, command. abstract != nil , command. discussion != nil {
32
+ MDocMacro . ParagraphBreak ( )
33
+ }
34
+
26
35
if let discussion = command. discussion {
27
36
discussion
28
37
}
@@ -46,7 +55,7 @@ struct SinglePageDescription: MDocComponent {
46
55
47
56
for subcommand in command. subcommands ?? [ ] {
48
57
MDocMacro . ListItem ( title: MDocMacro . Emphasis ( arguments: [ subcommand. commandName] ) )
49
- SinglePageDescription ( command: subcommand) . core
58
+ SinglePageDescription ( command: subcommand, root : false ) . core
50
59
}
51
60
}
52
61
}
You can’t perform that action at this time.
0 commit comments