= SimpleCLI Super Simple RubyGems-like CLI SimpleCLI gives you a stupidly simple way to implement command-line interfaces like that of RubyGems with a basic interface like: gem command [options] SimpleCLI gives you a way of defining your commands (or actions) so they'll automatically show up when you run `yourapp commands` SimpleCLI also makes it really easy to add documentation to each of your commands (or actions) == Real Examples I use SimpleCLI in most of my apps for quick and dirty command-line interfaces. Here are a few real examples: * {Syntax On}[http://github.com/remi/syntax-on/tree/master/lib/syntax-on/bin.rb] * {Domain Finder}[http://github.com/remi/domain-finder/tree/master/lib/domain-finder/bin.rb] * ADF[http://github.com/remi/adf/tree/master/lib/adf/bin.rb] == Example Here's a super simple SimpleCLI example: #! /usr/bin/env ruby require File.dirname(__FILE__) + '/../lib/simplecli' class Hello include SimpleCLI def usage puts < # show help for COMMAND #{ script_name } help # show this help message doco end def sayhello_help < 'sayhello' ).run end Example usage: $ ./hello-cli Hello CLI Usage: hello-cli command [options] Futher help: hello-cli commands # list all available commands hello-cli help # show help for COMMAND hello-cli help # show this help message $ ./hello-cli commands hello-cli commands are: DEFAULT COMMAND sayhello commands List all 'hello-cli' commands help Provide help documentation for a command sayhello Says hello! For help on a particular command, use 'hello-cli help COMMAND'. $ ./hello-cli help Usage: hello-cli help COMMAND Summary: Provide help documentation for a command $ ./hello-cli help sayhello Usage: hello-cli sayhello [SAY] Arguments: SAY: Something to say (default 'Hello World!') Summary: Says hello! $ ./hello-cli sayhello Hello World! $ ./hello-cli sayhello Hi There Hi There $ ./hello-cli Hi There `# this works because sayhello is configured as the default command` Hi There TODO ---- * implement command_missing method