Class: Madness::CommandLine
- Inherits:
-
Object
- Object
- Madness::CommandLine
- Includes:
- Colsole, Singleton
- Defined in:
- lib/madness/command_line.rb
Overview
Handle command line execution. Used by bin/madness.
Instance Method Summary collapse
-
#execute(argv = []) ⇒ Object
Process ARGV by putting it through docopt.
Instance Method Details
#execute(argv = []) ⇒ Object
Process ARGV by putting it through docopt
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/madness/command_line.rb', line 14 def execute(argv=[]) doc = File.read File.('docopt.txt', __dir__) begin args = Docopt.docopt(doc, argv: argv, version: VERSION) handle args rescue Docopt::Exit => e puts e. end end |