Module: Ark::CLI
- Defined in:
- lib/ark/cli.rb,
lib/ark/cli/spec.rb,
lib/ark/cli/option.rb,
lib/ark/cli/report.rb,
lib/ark/cli/argument.rb,
lib/ark/cli/interface.rb
Overview
A library for handling options and arguments from the command line.
Call #report to define a new interface and parse the command line. See README.md
or example/hello.rb
for more information.
Defined Under Namespace
Classes: Argument, Interface, Option, Report, Spec
Class Method Summary collapse
-
.report(args = ARGV, &block) ⇒ Object
:call-seq: report(input=ARGV) { |spec| … } => Report.
Class Method Details
.report(args = ARGV, &block) ⇒ Object
:call-seq: report(input=ARGV) { |spec| … } => Report
Convenience method for interface declarations. Yields a Spec
instance and returns a Report
instance for inspection.
args
is an array of strings, which defaults to ARGV
42 43 44 45 |
# File 'lib/ark/cli.rb', line 42 def self.report(args=ARGV, &block) i = Interface.new(args, &block) return i.report end |