harness
Warning: This tool is a work in progress. It has severe limitations. I'm working on this project in conjunction with another, extracting pieces of functionality that can belong in this package, able to be reused.
Quickly helps setup an opinionated CLI harness.
Installation
-
Add the dependency to your
shard.yml
:dependencies: harness: github: Willamin/harness
-
Run
shards install
Usage
require "harness"
class MyApp::Cli < Harness::Cli
@[Harness::Subcommand]
def version
STDOUT.puts("myapp 1.0.0")
end
end
Create a subclass of the type Harness::Cli
. This will get you setup with a harness for subcommand-style CLIs. To add a subcommand, write a method with the name of the subcommand and add the annotation @[Harness::Subcommand]
. This tells the harness to listen for this subcommand.
Contributing
- Fork it (https://github.com/Willamin/harness/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
- Will Lewis - creator and maintainer