From: Ben Beltran Date: Fri, 19 May 2017 03:44:25 +0000 (-0500) Subject: Show the optional arguments X-Git-Tag: 0.1.0^2~1^2~24 X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/commitdiff_plain/47f1de79ed1d0007dbba84dc3d511528c7fed3f0 Show the optional arguments --- 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) [ ]" + break + default: + formattedString = parseString + } + + return parser.defaultFormat(formattedString, type: type) + } + return (flags, parser) }