4 /// Sets up and returns a new options parser
6 /// - Returns: A new OptionParser instance
7 func createParser() -> ([String:Option], CommandLineKit) {
9 let parser = CommandLineKit()
10 var flags: [String:Option] = [:]
12 flags["help"] = BoolOption(shortFlag: "h", longFlag: "help", helpMessage: "Prints a help message.")
14 parser.addOptions(Array(flags.values))
16 return (flags, parser)
21 let (flags, parser) = createParser()
27 parser.printUsage(error)
31 if let helpFlag = flags["help"] as? BoolOption {
32 if helpFlag.value == true {