Fix warning with Swift 4.2 / Xcode 10 (#16) “Static declarations are implicitly ‘final’; use ‘public’ instead of ‘open’”
Fix warning with Swift 4.2 / Xcode 10 (#16)
“Static declarations are implicitly ‘final’; use ‘public’ instead of ‘open’”
docopt.swift is a Swift port of docopt ======================================================================
docopt.swift
docopt.swift helps you create most beautiful command-line interfaces easily:
Swift:
let doc : String = """ Not a serious example. Usage: calculator_example.py <value> ( ( + | - | * | / ) <value> )... calculator_example.py <function> <value> [( , <value> )]... calculator_example.py (-h | --help) Examples: calculator_example.py 1 + 2 + 3 + 4 + 5 calculator_example.py 1 + 2 '*' 3 / 4 - 5 # note quotes around '*' calculator_example.py sum 10 , 20 , 30 , 40 Options: -h, --help """ var args = Process.arguments args.removeAtIndex(0) // arguments[0] is always the program_name let result = Docopt.parse(doc, argv: args, help: true, version: "1.0") println("Docopt result: \(result)")
Objective-C:
NSArray *arguments = [[NSProcessInfo processInfo] arguments]; arguments = arguments.count > 1 ? [arguments subarrayWithRange:NSMakeRange(1, arguments.count - 1)] : @[]; NSDictionary *result = [Docopt parse:doc argv:arguments help:YES version:@"1.0" optionsFirst:NO]; NSLog(@"Docopt result:\n%@", result);
docopt
Swift Package Manager:
.package(url: "https://github.com/docopt/docopt.swift", from: "0.6.6"),
Docopt
Docopt.framework
docopt.swift is released under the MIT License.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
docopt.swift
is a Swift port of docopt ======================================================================docopt.swift helps you create most beautiful command-line interfaces easily:
Swift:
Objective-C:
Installation
Swift:
docopt.swift
docopt
folder to your projectSwift Package Manager:
Objective-C:
docopt.swift
Docopt
targetDocopt.framework
to your projectLicense
docopt.swift
is released under the MIT License.