This mapping has 11 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

Before

…lines 1–12 unchanged (12 lines)
13import XCTest
14
15@testable import ArgumentParser
16
17final class HelpTests: XCTestCase {
18 override func setUp() {
19 #if !os(Windows) && !os(WASI)
20 unsetenv("COLUMNS")
21 #endif
22 }
23}
24
25func getErrorText<T: ParsableArguments>(_: T.Type, _ arguments: [String])
26 -> String
27{
…lines 28–51 unchanged (24 lines)
52
53// swift-format-ignore: AlwaysUseLowerCamelCase
54// https://github.com/apple/swift-argument-parser/issues/710
55extension HelpTests {
56 func testGlobalHelp() throws {
57 XCTAssertEqual(
58 getErrorText(Package.self, ["help"]).trimmingLines(),
59 """
60 USAGE: package <subcommand>
61
62 OPTIONS:
63 -h, --help Show help information.
64
65 SUBCOMMANDS:
66 clean
67 config
68 describe
69 generate-xcodeproj
70
71 See 'package help <subcommand>' for detailed help.
72 """.trimmingLines())
73 }
74
75 func testGlobalHelp_messageForCleanExit_helpRequest() throws {
76 XCTAssertEqual(
77 Package.message(for: CleanExit.helpRequest()).trimmingLines(),
78 """
79 USAGE: package <subcommand>
80
81 OPTIONS:
82 -h, --help Show help information.
83
84 SUBCOMMANDS:
85 clean
86 config
87 describe
88 generate-xcodeproj
89
90 See 'package help <subcommand>' for detailed help.
91 """.trimmingLines()
92 )
93 }
94
95 func testGlobalHelp_messageForCleanExit_message() throws {
96 let expectedMessage = "Failure"
97 XCTAssertEqual(
98 Package.message(for: CleanExit.message(expectedMessage)).trimmingLines(),
99 expectedMessage
100 )
101 }
102
103 func testConfigHelp() throws {
104 XCTAssertEqual(
105 getErrorText(Package.self, ["help", "config"], screenWidth: 80)
106 .trimmingLines(),
107 """
108 USAGE: package config <subcommand>
109
110 OPTIONS:
111 -h, --help Show help information.
112
113 SUBCOMMANDS:
114 get-mirror
115 set-mirror
116 unset-mirror
117
118 See 'package help config <subcommand>' for detailed help.
119 """.trimmingLines())
120 }
121
122 func testGetMirrorHelp() throws {
123 XCTAssertEqual(
124 getErrorText(
125 Package.self, ["help", "config", "get-mirror"], screenWidth: 80
126 ).trimmingLines(),
127 """
128 USAGE: package config get-mirror [<options>] --package-url <package-url>
129
130 OPTIONS:
131 --build-path <build-path>
132 Specify build/cache directory (default: ./.build)
…lines 133–165 unchanged (33 lines)
166 -Xswiftc <swift-compiler-flag>
167 Pass flag through to all Swift compiler invocations
168 --package-url <package-url>
169 The package dependency URL
170 -h, --help Show help information.
171
172 """.trimmingLines())
173 }
174}
175
176struct Simple: ParsableArguments {
177 @Flag var verbose: Bool = false
178 @Option() var min: Int?
…lines 179–185 unchanged (7 lines)
186
187 OPTIONS:
188 --verbose
189 --min <min>
190 -h, --help Show help information.
191
192 """.trimmingLines()
193}
194
195extension HelpTests {
196 func testSimpleHelp() throws {
197 XCTAssertEqual(
198 getErrorText(Simple.self, ["--help"]).trimmingLines(),
199 Simple.helpText)
200 XCTAssertEqual(
201 getErrorText(Simple.self, ["-h"]).trimmingLines(),
202 Simple.helpText)
203 }
204}
205
206struct CustomHelp: ParsableCommand {
207 static let configuration = CommandConfiguration(
…lines 208–246 unchanged (39 lines)
247 Error: Missing expected argument '--count <count>'
248 Help: --count <count> How many florps?
249 Usage: no-help --count <count>
250 """)
251
252 XCTAssertEqual(
253 NoHelp.message(for: CleanExit.helpRequest()).trimmingLines(),
254 """
255 USAGE: no-help --count <count>
256
257 OPTIONS:
258 --count <count> How many florps?
259
…lines 260–310 unchanged (51 lines)

After

…lines 1–12 unchanged (12 lines)
13import XCTest
14
15@testable import ArgumentParser
16
17final class HelpTests: XCTestCase {
18 override func setUp() {
19 Platform.Environment[.columns] = nil
20 }
21}
22
23func getErrorText<T: ParsableArguments>(_: T.Type, _ arguments: [String])
24 -> String
25{
…lines 26–49 unchanged (24 lines)
50
51// swift-format-ignore: AlwaysUseLowerCamelCase
52// https://github.com/apple/swift-argument-parser/issues/710
53extension HelpTests {
54 func testGlobalHelp() throws {
55 XCTAssertEqual(
56 getErrorText(Package.self, ["help"]),
57 """
58 USAGE: package <subcommand>
59
60 OPTIONS:
61 -h, --help Show help information.
62
63 SUBCOMMANDS:
64 clean
65 config
66 describe
67 generate-xcodeproj
68
69 See 'package help <subcommand>' for detailed help.
70 """)
71 }
72
73 func testGlobalHelp_messageForCleanExit_helpRequest() throws {
74 XCTAssertEqual(
75 Package.message(for: CleanExit.helpRequest()),
76 """
77 USAGE: package <subcommand>
78
79 OPTIONS:
80 -h, --help Show help information.
81
82 SUBCOMMANDS:
83 clean
84 config
85 describe
86 generate-xcodeproj
87
88 See 'package help <subcommand>' for detailed help.
89 """
90 )
91 }
92
93 func testGlobalHelp_messageForCleanExit_message() throws {
94 let expectedMessage = "Failure"
95 XCTAssertEqual(
96 Package.message(for: CleanExit.message(expectedMessage)),
97 expectedMessage
98 )
99 }
100
101 func testConfigHelp() throws {
102 XCTAssertEqual(
103 getErrorText(Package.self, ["help", "config"], screenWidth: 80),
104 """
105 USAGE: package config <subcommand>
106
107 OPTIONS:
108 -h, --help Show help information.
109
110 SUBCOMMANDS:
111 get-mirror
112 set-mirror
113 unset-mirror
114
115 See 'package help config <subcommand>' for detailed help.
116 """)
117 }
118
119 func testGetMirrorHelp() throws {
120 XCTAssertEqual(
121 getErrorText(
122 Package.self, ["help", "config", "get-mirror"], screenWidth: 80
123 ),
124 """
125 USAGE: package config get-mirror [<options>] --package-url <package-url>
126
127 OPTIONS:
128 --build-path <build-path>
129 Specify build/cache directory (default: ./.build)
…lines 130–162 unchanged (33 lines)
163 -Xswiftc <swift-compiler-flag>
164 Pass flag through to all Swift compiler invocations
165 --package-url <package-url>
166 The package dependency URL
167 -h, --help Show help information.
168
169 """)
170 }
171}
172
173struct Simple: ParsableArguments {
174 @Flag var verbose: Bool = false
175 @Option() var min: Int?
…lines 176–183 unchanged (8 lines)
184 OPTIONS:
185 --verbose
186 --min <min>
187 -h, --help Show help information.
188
189 """
190}
191
192extension HelpTests {
193 func testSimpleHelp() throws {
194 XCTAssertEqual(
195 getErrorText(Simple.self, ["--help"]),
196 Simple.helpText)
197 XCTAssertEqual(
198 getErrorText(Simple.self, ["-h"]),
199 Simple.helpText)
200 }
201}
202
203struct CustomHelp: ParsableCommand {
204 static let configuration = CommandConfiguration(
…lines 205–243 unchanged (39 lines)
244 Error: Missing expected argument '--count <count>'
245 Help: --count <count> How many florps?
246 Usage: no-help --count <count>
247 """)
248
249 XCTAssertEqual(
250 NoHelp.message(for: CleanExit.helpRequest()),
251 """
252 USAGE: no-help --count <count>
253
254 OPTIONS:
255 --count <count> How many florps?
256
…lines 257–307 unchanged (51 lines)

Before

source_file
comment "//===-------------------------------------------------------"...
comment "//"
comment "// This source file is part of the Swift Argument Parser ope"...
comment "//"
comment "// Copyright (c) 2020 Apple Inc. and the Swift project autho"...
comment "// Licensed under Apache License v2.0 with Runtime Library E"...
comment "//"
comment "// See https://swift.org/LICENSE.txt for license information"
comment "//"
comment "//===-------------------------------------------------------"...
import_declaration
import "import"
identifier
simple_identifier "ArgumentParserTestHelpers"
import_declaration
import "import"
identifier
simple_identifier "XCTest"
import_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "testable"
import "import"
identifier
simple_identifier "ArgumentParser"
class_declaration
modifiers
inheritance_modifier
final "final"
class "class"
type_identifier "HelpTests"
: ":"
inheritance_specifier
user_type
type_identifier "XCTestCase"
class_body
{ "{"
function_declaration
modifiers
member_modifier
override "override"
func "func"
simple_identifier "setUp"
( "("
) ")"
function_body
{ "{"
statements
directive
#if "#if"
! "!"
os "os"
( "("
simple_identifier "Windows"
) ")"
&& "&&"
! "!"
os "os"
( "("
simple_identifier "WASI"
) ")"
call_expression
simple_identifier "unsetenv"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "COLUMNS"
" "\""
) ")"
directive
#endif "#endif"
} "}"
} "}"
function_declaration (+99 nodes collapsed)
function_declaration (+143 nodes collapsed)
comment "// swift-format-ignore: AlwaysUseLowerCamelCase"
comment "// https://github.com/apple/swift-argument-parser/issues/710"
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testGlobalHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "help"
" "\""
] "]"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
call_expression
navigation_expression
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package <subcommand>\n\n OPTIONS:\n -"...
""" "\"\"\""
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGlobalHelp_messageForCleanExit_helpRequest"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "helpRequest"
call_suffix
value_arguments
( "("
) ")"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
call_expression
navigation_expression
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package <subcommand>\n\n OPTIONS:\n -"...
""" "\"\"\""
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGlobalHelp_messageForCleanExit_message"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "expectedMessage"
= "="
line_string_literal
" "\""
line_str_text "Failure"
" "\""
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "expectedMessage"
) ")"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
simple_identifier "expectedMessage"
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testConfigHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix (+30 nodes collapsed)
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
call_expression
navigation_expression
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package config <subcommand>\n\n OPTIONS:\n "...
""" "\"\"\""
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGetMirrorHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix (+35 nodes collapsed)
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
call_expression
navigation_expression
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package config get-mirror [<options>] --packag"...
""" "\"\"\""
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
) ")"
} "}"
} "}"
class_declaration
struct "struct"
type_identifier "Simple"
: ":"
inheritance_specifier
user_type
type_identifier "ParsableArguments"
class_body
{ "{"
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Flag"
value_binding_pattern
var "var"
pattern
simple_identifier "verbose"
type_annotation
: ":"
user_type
type_identifier "Bool"
= "="
boolean_literal
false "false"
property_declaration (+21 nodes collapsed)
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Argument"
( "("
bang
! ""
) ")"
value_binding_pattern
var "var"
pattern
simple_identifier "max"
type_annotation
: ":"
user_type
type_identifier "Int"
property_declaration
modifiers
property_modifier
static "static"
value_binding_pattern
let "let"
pattern
simple_identifier "helpText"
= "="
call_expression
navigation_expression
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: simple [--verbose] [--min <min>] <max>\n\n ARGU"...
""" "\"\"\""
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
} "}"
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testSimpleHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "--help"
" "\""
] "]"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "helpText"
) ")"
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "-h"
" "\""
] "]"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "helpText"
) ")"
} "}"
} "}"
class_declaration (+59 nodes collapsed)
class_declaration (+167 nodes collapsed)
class_declaration (+54 nodes collapsed)
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testNoHelpNames"
( "("
) ")"
function_body
{ "{"
statements
property_declaration (+29 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "helpNames"
, ","
value_argument
array_literal
[ "["
] "]"
) ")"
property_declaration (+29 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "helpHiddenNames"
, ","
value_argument
array_literal
[ "["
] "]"
) ")"
call_expression (+27 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "NoHelp"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "helpRequest"
call_suffix
value_arguments
( "("
) ")"
) ")"
navigation_suffix
. "."
simple_identifier "trimmingLines"
call_suffix
value_arguments
( "("
) ")"
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: no-help --count <count>\n\n OPTIONS:\n "...
""" "\"\"\""
) ")"
} "}"
} "}"
class_declaration (+138 nodes collapsed)
class_declaration (+291 nodes collapsed)

After

source_file
comment "//===-------------------------------------------------------"...
comment "//"
comment "// This source file is part of the Swift Argument Parser ope"...
comment "//"
comment "// Copyright (c) 2020 Apple Inc. and the Swift project autho"...
comment "// Licensed under Apache License v2.0 with Runtime Library E"...
comment "//"
comment "// See https://swift.org/LICENSE.txt for license information"
comment "//"
comment "//===-------------------------------------------------------"...
import_declaration
import "import"
identifier
simple_identifier "ArgumentParserTestHelpers"
import_declaration
import "import"
identifier
simple_identifier "XCTest"
import_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "testable"
import "import"
identifier
simple_identifier "ArgumentParser"
class_declaration
modifiers
inheritance_modifier
final "final"
class "class"
type_identifier "HelpTests"
: ":"
inheritance_specifier
user_type
type_identifier "XCTestCase"
class_body
{ "{"
function_declaration
modifiers
member_modifier
override "override"
func "func"
simple_identifier "setUp"
( "("
) ")"
function_body
{ "{"
statements
assignment
directly_assignable_expression
call_expression
navigation_expression
simple_identifier "Platform"
navigation_suffix
. "."
simple_identifier "Environment"
call_suffix
value_arguments
[ "["
value_argument
prefix_expression
. "."
simple_identifier "columns"
] "]"
= "="
nil "nil"
} "}"
} "}"
function_declaration (+99 nodes collapsed)
function_declaration (+143 nodes collapsed)
comment "// swift-format-ignore: AlwaysUseLowerCamelCase"
comment "// https://github.com/apple/swift-argument-parser/issues/710"
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testGlobalHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "help"
" "\""
] "]"
) ")"
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package <subcommand>\n\n OPTIONS:\n -"...
""" "\"\"\""
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGlobalHelp_messageForCleanExit_helpRequest"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "helpRequest"
call_suffix
value_arguments
( "("
) ")"
) ")"
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package <subcommand>\n\n OPTIONS:\n -"...
""" "\"\"\""
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGlobalHelp_messageForCleanExit_message"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "expectedMessage"
= "="
line_string_literal
" "\""
line_str_text "Failure"
" "\""
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "Package"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "expectedMessage"
) ")"
) ")"
, ","
value_argument
simple_identifier "expectedMessage"
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testConfigHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix (+30 nodes collapsed)
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package config <subcommand>\n\n OPTIONS:\n "...
""" "\"\"\""
) ")"
} "}"
function_declaration
func "func"
simple_identifier "testGetMirrorHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix (+35 nodes collapsed)
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: package config get-mirror [<options>] --packag"...
""" "\"\"\""
) ")"
} "}"
} "}"
class_declaration
struct "struct"
type_identifier "Simple"
: ":"
inheritance_specifier
user_type
type_identifier "ParsableArguments"
class_body
{ "{"
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Flag"
value_binding_pattern
var "var"
pattern
simple_identifier "verbose"
type_annotation
: ":"
user_type
type_identifier "Bool"
= "="
boolean_literal
false "false"
property_declaration (+21 nodes collapsed)
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Argument"
( "("
bang
! ""
) ")"
value_binding_pattern
var "var"
pattern
simple_identifier "max"
type_annotation
: ":"
user_type
type_identifier "Int"
property_declaration
modifiers
property_modifier
static "static"
value_binding_pattern
let "let"
pattern
simple_identifier "helpText"
= "="
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: simple [--verbose] [--min <min>] <max>\n\n ARGU"...
""" "\"\"\""
} "}"
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testSimpleHelp"
( "("
) ")"
throws "throws"
function_body
{ "{"
statements
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "--help"
" "\""
] "]"
) ")"
, ","
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "helpText"
) ")"
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
simple_identifier "getErrorText"
call_suffix
value_arguments
( "("
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "self"
, ","
value_argument
array_literal
[ "["
line_string_literal
" "\""
line_str_text "-h"
" "\""
] "]"
) ")"
, ","
value_argument
navigation_expression
simple_identifier "Simple"
navigation_suffix
. "."
simple_identifier "helpText"
) ")"
} "}"
} "}"
class_declaration (+59 nodes collapsed)
class_declaration (+167 nodes collapsed)
class_declaration (+54 nodes collapsed)
class_declaration
extension "extension"
user_type
type_identifier "HelpTests"
class_body
{ "{"
function_declaration
func "func"
simple_identifier "testNoHelpNames"
( "("
) ")"
function_body
{ "{"
statements
property_declaration (+29 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "helpNames"
, ","
value_argument
array_literal
[ "["
] "]"
) ")"
property_declaration (+29 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "helpHiddenNames"
, ","
value_argument
array_literal
[ "["
] "]"
) ")"
call_expression (+27 nodes collapsed)
call_expression
simple_identifier "XCTAssertEqual"
call_suffix
value_arguments
( "("
value_argument
call_expression any 2:1
navigation_expression any 2:1
simple_identifier "NoHelp"
navigation_suffix
. "."
simple_identifier "message"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "for"
: ":"
call_expression
navigation_expression
simple_identifier "CleanExit"
navigation_suffix
. "."
simple_identifier "helpRequest"
call_suffix
value_arguments
( "("
) ")"
) ")"
, ","
value_argument
multi_line_string_literal
""" "\"\"\""
multi_line_str_text "\n USAGE: no-help --count <count>\n\n OPTIONS:\n "...
""" "\"\"\""
) ")"
} "}"
} "}"
class_declaration (+138 nodes collapsed)
class_declaration (+291 nodes collapsed)