]> git.r.bdr.sh - rbdr/lyricli/blobdiff - Sources/main.swift
Show the optional arguments
[rbdr/lyricli] / Sources / main.swift
index 0ae48bcd891837259fa344cfb4c14feb394e2651..42d485588fabfcb72c064c0f8748811d9e7fe334 100644 (file)
@@ -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)
 }
 
@@ -80,7 +95,7 @@ func main() {
 
     if let titleFlag = flags["title"] as? BoolOption {
         if titleFlag.value == true {
-            Lyricli.printTitle()
+            Lyricli.showTitle = true
         }
     }