+// Entry point of the application. This is the main executable
+private func main() {
+ let (flags, parser) = createParser()
+
+ do {
+ try parser.parse()
+ } catch {
+ parser.printUsage(error)
+ exit(EX_USAGE)
+ }
+
+ // Boolean Options
+
+ checkHelpFlag(flags["help"], withParser: parser)
+ checkVersionFlag(flags["version"], withParser: parser)
+ checkListSourcesFlag(flags["listSources"], withParser: parser)
+ checkTitleFlag(flags["title"], withParser: parser)
+
+ // String Options
+
+ checkEnableSourceFlag(flags["enableSource"], withParser: parser)
+ checkDisableSourceFlag(flags["disableSource"], withParser: parser)
+ checkResetSourceFlag(flags["resetSource"], withParser: parser)
+
+ // Remove any flags so anyone after this gets the unprocessed values
+
+ let programName: [String] = [CommandLine.arguments[0]]
+ CommandLine.arguments = programName + parser.unparsedArguments
+
+ // Run Lyricli
+
+ Lyricli.printLyrics()
+}
+