Class: Pandocomatic::CLI
- Inherits:
-
Object
- Object
- Pandocomatic::CLI
- Defined in:
- lib/pandocomatic/cli.rb
Overview
Command line options parser for pandocomatic using optimist.
Class Method Summary collapse
-
.parse!(args) ⇒ Configuration
Parse the arguments, returns a triplet with the global options, an optional subcommand, and the (optional) options for that subcommand.
Class Method Details
.parse!(args) ⇒ Configuration
Parse the arguments, returns a triplet with the global options, an optional subcommand, and the (optional) options for that subcommand.
As a side effect, this method will create and install a logger for Pandocomatic::LOG.
the command-line options.
44 45 46 47 48 49 50 51 52 |
# File 'lib/pandocomatic/cli.rb', line 44 def self.parse!(args) args = args.split if args.is_a? String begin args || Configuration.new({ help: true, help_given: true }) rescue Optimist::CommandlineError => e raise CLIError.new(:problematic_invocation, e, args) end end |