File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Tests/ArgumentParserUnitTests Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,29 @@ extension HelpGenerationTests {
547
547
XCTAssertEqual ( AllValues . SpecializedSynthesized. allValueStrings, opts [ 4 ] . help. allValues)
548
548
XCTAssertEqual ( AllValues . SpecializedSynthesized. allValueStrings, opts [ 5 ] . help. allValues)
549
549
}
550
+
551
+ struct Q : ParsableArguments {
552
+ @Option ( help: " Your name " ) var name : String
553
+ @Option ( help: " Your title " ) var title : String ?
554
+
555
+ @Argument ( help: . private) var privateName : String ?
556
+ @Option ( help: . private) var privateTitle : String ?
557
+ @Flag ( help: . private) var privateFlag : Bool = false
558
+ @Flag ( inversion: . prefixedNo, help: . private) var privateInvertedFlag : Bool = true
559
+ }
560
+
561
+ func testHelpWithPrivate( ) {
562
+ // For now, hidden and private have the same behaviour
563
+ AssertHelp ( for: Q . self, equals: """
564
+ USAGE: q --name <name> [--title <title>]
565
+
566
+ OPTIONS:
567
+ --name <name> Your name
568
+ --title <title> Your title
569
+ -h, --help Show help information.
570
+
571
+ """ )
572
+ }
550
573
}
551
574
552
575
// MARK: - Issue #278 https://github.com/apple/swift-argument-parser/issues/278
You can’t perform that action at this time.
0 commit comments