@@ -597,6 +597,9 @@ public final class ArgumentParser {
597597
598598 /// Overview text of this parser.
599599 let overview : String
600+
601+ /// See more text of this parser.
602+ let seeAlso : String ?
600603
601604 /// If this parser is a subparser.
602605 private let isSubparser : Bool
@@ -613,11 +616,13 @@ public final class ArgumentParser {
613616 /// Otherwise, first command line argument will be used.
614617 /// - usage: The "usage" line of the generated usage text.
615618 /// - overview: The "overview" line of the generated usage text.
616- public init ( commandName: String ? = nil , usage: String , overview: String ) {
619+ /// - seeAlso: The "see also" line of generated usage text.
620+ public init ( commandName: String ? = nil , usage: String , overview: String , seeAlso: String ? = nil ) {
617621 self . isSubparser = false
618622 self . commandName = commandName
619623 self . usage = usage
620624 self . overview = overview
625+ self . seeAlso = seeAlso
621626 }
622627
623628 /// Create a subparser with its help text.
@@ -626,6 +631,7 @@ public final class ArgumentParser {
626631 self . commandName = nil
627632 self . usage = " "
628633 self . overview = overview
634+ self . seeAlso = nil
629635 }
630636
631637 /// Adds an option to the parser.
@@ -901,6 +907,12 @@ public final class ArgumentParser {
901907 print ( formatted: argument. name, usage: usage, on: stream)
902908 }
903909 }
910+
911+ if let seeAlso = seeAlso {
912+ stream <<< " \n \n "
913+ stream <<< " SEE ALSO: \( seeAlso) "
914+ }
915+
904916 stream <<< " \n "
905917 stream. flush ( )
906918 }
0 commit comments