An open API service indexing awesome lists of open source software.

https://github.com/dannyben/super_docopt

docopt-based command line utility builder
https://github.com/dannyben/super_docopt

cli-utilities command-line-parser docopt gem ruby

Last synced: 6 months ago
JSON representation

docopt-based command line utility builder

Awesome Lists containing this project

README

          

Super Docopt
==================================================

[![Gem Version](https://badge.fury.io/rb/super_docopt.svg)](https://badge.fury.io/rb/super_docopt)
[![Build Status](https://github.com/DannyBen/super_docopt/workflows/Test/badge.svg)](https://github.com/DannyBen/super_docopt/actions?query=workflow%3ATest)
[![Maintainability](https://api.codeclimate.com/v1/badges/2ca07d88e6f7b0b57e82/maintainability)](https://codeclimate.com/github/DannyBen/super_docopt/maintainability)

---

Create command line utilities with ease.
*Super Docopt* is an extension that provides syntactic sugar to [Docopt][1]

---

Install
--------------------------------------------------

$ gem install super_docopt

Getting Started
--------------------------------------------------

```ruby
# my_command_line.rb
require 'super_docopt'

class MyCommandLine < SuperDocopt::Base
version '1.0.0'
docopt 'docopt.txt'
subcommands ['download', 'upload']

def download
puts "#download called with #{args}"
end

def upload
puts "#upload called"
end
end

MyCommandLine.execute ARGV
```

```plain
# docopt.txt
My Command Line

Usage:
mock download [--force]
mock upload
mock (-h|--help|--version)
```

See the [examples](/examples) folder for more examples.

---

[1]: http://docopt.org/