cmds
cmds.cr 
Yet another CLI Builder library for Crystal (0.26.1).
features
- Simple and readable syntax for command and task
- Automatic generation of command candidates
- Automatic generation of task candidates
- Automatic generation of usages
Usage
require "cmds"
Cmds.command "json" do
usage "pretty file.json"
task "pretty" do
path = args.shift? || abort "specify file"
puts Pretty.json(File.read(path))
end
end
Cmds.run(ARGV)
$ prog
Error: unknown command: ''
Possible commands are: ["json"]
$ prog json
Error: unknown task: ''
Possible tasks are: ["pretty"]
prog json pretty file.json
$ prog json pretty
specify file
Installation
Add this to your application's shard.yml
:
dependencies:
cmds:
github: maiha/cmds.cr
version: 0.1.1
Development
make test
Contributing
- Fork it (https://github.com/maiha/cmds.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- maiha maiha - creator, maintainer