File tree 3 files changed +14
-7
lines changed
Sources/ArgumentParser/Completions
ArgumentParserExampleTests/Snapshots
ArgumentParserUnitTests/Snapshots 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,7 @@ extension [ParsableCommand.Type] {
19
19
return """
20
20
function \( commandsAndPositionalsFunctionName) -S
21
21
switch $POSITIONALS[1]
22
- \( commandCases) \
23
- end
22
+ \( commandCases)
24
23
case '*'
25
24
set COMMANDS $POSITIONALS[1]
26
25
set -e POSITIONALS[1]
@@ -91,11 +90,19 @@ extension [ParsableCommand.Type] {
91
90
return """
92
91
case ' \( last!. _commandName) '
93
92
\( commandsAndPositionalsFunctionName) _helper ' \(
94
- subcommands. isEmpty ? " " : " -s "
93
+ subcommands. isEmpty ? " " : " -s "
95
94
) ' ' \( completableArguments. compactMap ( \. optionSpec) . map { " \( $0) " } . joined ( separator: separator) ) ' \(
96
- subcommands. isEmpty ? " " : " \n switch $POSITIONALS[1] " )
97
- \( subcommands. map { ( self + [ $0] ) . commandCases } . joined ( separator: " " ) )
98
- """ . indentingEachLine ( by: 4 )
95
+ subcommands. isEmpty ?
96
+ " "
97
+ : """
98
+
99
+ switch $POSITIONALS[1]
100
+ \( subcommands. map { ( self + [ $0] ) . commandCases } . joined ( separator: " \n " ) )
101
+ end
102
+ """
103
+ )
104
+ """
105
+ . indentingEachLine ( by: 4 )
99
106
}
100
107
101
108
private var completions : [ String ] {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ function _swift_math_commands_and_positionals -S
16
16
_swift_math_commands_and_positionals_helper ' ' ' version h/help'
17
17
case ' quantiles'
18
18
_swift_math_commands_and_positionals_helper ' ' ' file= directory= shell= custom= version h/help'
19
+ end
19
20
case ' help'
20
21
_swift_math_commands_and_positionals_helper ' ' ' version'
21
22
end
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ function _swift_base-test_commands_and_positionals -S
2
2
switch $POSITIONALS [1]
3
3
case ' base-test'
4
4
_swift_base-test_commands_and_positionals_helper ' ' ' name= kind= other-kind= path1= path2= path3= one two three kind-counter rep1= r/rep2= h/help'
5
- end
6
5
case ' *'
7
6
set COMMANDS $POSITIONALS [1]
8
7
set -e POSITIONALS[1]
You can’t perform that action at this time.
0 commit comments