/// Sets up and returns a new options parser
///
-/// - Returns: A new OptionParser instance
+/// - Returns: A Dictionary of Options, and a new CommandLineKit instance
func createParser() -> ([String:Option], CommandLineKit) {
let parser = CommandLineKit()
var flags: [String:Option] = [:]
flags["help"] = BoolOption(shortFlag: "h", longFlag: "help", helpMessage: "Prints a help message.")
+ flags["version"] = BoolOption(shortFlag: "v", longFlag: "version", helpMessage: "Prints the version.")
parser.addOptions(Array(flags.values))
}
}
+ if let versionFlag = flags["version"] as? BoolOption {
+ if versionFlag.value == true {
+ print(Lyricli.version)
+ exit(0)
+ }
+ }
+
}
main()