Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README

Subcommand
==========

A minimal command line parser for subcommands.

* Subcommand parses commands of type "COMMAND SUBCOMMAND ARG1 ARG2 ...".
* No switches are supported (like -v)
* Last argument can be made optional by surrounding it with []
* Default command can be set. It's called when user runs the executable
  with no arguments.

An example:

sub = Subcommand.new

sub.register('create', ['TITLE'], 'Create TODO item with title TITLE.') do |title|
  Todo.create!(title)
end

sub.register('list', [], 'List all TODO items.') do
  list_all_todos
end

sub.default = 'list'

sub.parse

About

A minimal command line parser for subcommands.

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.