All Projects → docopt → docopt.swift

docopt / docopt.swift

Licence: MIT license
A command-line interface description language and parser that will make you smile http://docopt.org/

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to docopt.swift

docopt-ng
Humane command line arguments parser. Now with maintenance, typehints, and complete test coverage.
Stars: ✭ 94 (+77.36%)
Mutual labels:  argument-parser, docopt
parseargs
Migrated to https://github.com/denoland/deno_std
Stars: ✭ 28 (-47.17%)
Mutual labels:  argument-parser
argparser
Simple command-line parser for C/C++ programs
Stars: ✭ 50 (-5.66%)
Mutual labels:  argument-parser
declarative-parser
Modern, declarative argument parser for Python 3.6+
Stars: ✭ 31 (-41.51%)
Mutual labels:  argument-parser
google-options
Command line argument parsing library from the folks at Google (java).
Stars: ✭ 61 (+15.09%)
Mutual labels:  argument-parser
Moderator
A simple, modular command line argument parser in Swift.
Stars: ✭ 19 (-64.15%)
Mutual labels:  argument-parser
sf
Simple Bash framework which provides argument parsing, usage output and text formatting variables
Stars: ✭ 16 (-69.81%)
Mutual labels:  argument-parser
args-parser
args-parser is a small C++ header-only library for parsing command line arguments.
Stars: ✭ 53 (+0%)
Mutual labels:  argument-parser
theconf
Python Package for Managing Configurations
Stars: ✭ 35 (-33.96%)
Mutual labels:  argument-parser
ArgMacros.jl
Fast, flexible, macro-based, Julia package for parsing command line arguments.
Stars: ✭ 29 (-45.28%)
Mutual labels:  argument-parser
argparse-to-class
Transform argparse into class format for Jupyter Notebook execution
Stars: ✭ 20 (-62.26%)
Mutual labels:  argument-parser
vargs
Simple argument parsing library for V.
Stars: ✭ 36 (-32.08%)
Mutual labels:  argument-parser
gen
Simple scaffolding tool for WEB / GUI / CLI apps written in Nim Lang
Stars: ✭ 44 (-16.98%)
Mutual labels:  docopt
django-docopt-command
Django-docopt-command allows you to write Django manage.py commands using the docopt library
Stars: ✭ 24 (-54.72%)
Mutual labels:  docopt
option-parser
A Lightweight, header-only CLI option parser for C++
Stars: ✭ 16 (-69.81%)
Mutual labels:  argument-parser
args
Simple and type-safe commandline argument parser for C++14
Stars: ✭ 63 (+18.87%)
Mutual labels:  argument-parser
dropt
dropt is yet another C library for parsing command-line options.
Stars: ✭ 39 (-26.42%)
Mutual labels:  argument-parser
Console CommandLine
Full featured command line options and arguments parser.
Stars: ✭ 19 (-64.15%)
Mutual labels:  argument-parser
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+62.26%)
Mutual labels:  argument-parser
typed-argument-parser
Typed argument parser for Python
Stars: ✭ 259 (+388.68%)
Mutual labels:  argument-parser

build status docopt.swift is a Swift port of docopt

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);

Installation

Swift:

  • Check out docopt.swift
  • Add docopt folder to your project

Swift Package Manager:

.package(url: "https://github.com/docopt/docopt.swift", from: "0.6.6"),

Objective-C:

  • Check out docopt.swift
  • Build Docopt target
  • Add Docopt.framework to your project

License

docopt.swift is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].