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
- Host: GitHub
- URL: https://github.com/dannyben/super_docopt
- Owner: DannyBen
- License: mit
- Created: 2018-02-09T21:08:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-30T15:54:10.000Z (over 2 years ago)
- Last Synced: 2024-05-01T14:12:12.058Z (over 1 year ago)
- Topics: cli-utilities, command-line-parser, docopt, gem, ruby
- Language: Ruby
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Super Docopt
==================================================
[](https://badge.fury.io/rb/super_docopt)
[](https://github.com/DannyBen/super_docopt/actions?query=workflow%3ATest)
[](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/