diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-05-18 22:44:25 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-05-18 22:44:25 -0500 |
| commit | 47f1de79ed1d0007dbba84dc3d511528c7fed3f0 (patch) | |
| tree | eb559136b782991cab4c7f8d3eea9b5ec414f9cc /Sources | |
| parent | 1158b489f752529b4801170fc888e44e5041b58f (diff) | |
Show the optional arguments
Diffstat (limited to 'Sources')
| -rw-r--r-- | Sources/main.swift | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Sources/main.swift b/Sources/main.swift index e4b2760..42d4855 100644 --- a/Sources/main.swift +++ b/Sources/main.swift @@ -21,6 +21,21 @@ func createParser() -> ([String:Option], CommandLineKit) { parser.addOptions(Array(flags.values)) + parser.formatOutput = {parseString, type in + + var formattedString: String + + switch(type) { + case .About: + formattedString = "\(parseString) [<artist_name> <song_name>]" + break + default: + formattedString = parseString + } + + return parser.defaultFormat(formattedString, type: type) + } + return (flags, parser) } |