Class: Plist4r::CLI

Inherits:
Object show all
Includes:
Mixlib::CLI
Defined in:
lib/plist4r/cli.rb

Overview

Defines options for the plist4r command line utility

Instance Attribute Summary

Attributes included from Mixlib::CLI

#banner, #config, #opt_parser, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixlib::CLI

#build_option_arguments, #initialize, #parse_options

Class Method Details

.plist4r_cli_optionsObject

The Plist4r CLI Options

Usage: bin/plist4r (options)

-b, --brew        Customize for Brew. Use with --ruby-lib.
-d, --dir DIR     The directory to dump files into. Use with --ruby-lib. Defaults to cwd.
-r, --ruby-lib    Convert plist4r gem into a ruby lib, and write to the filesystem. (required)
-h, --help        Show this message


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/plist4r/cli.rb', line 17

def self.plist4r_cli_options
  option :ruby_lib, :required => true,
    :short => "-r", :long  => "--ruby-lib", :boolean => true, :default => false, 
    :description => "Convert plist4r gem into a ruby lib, and write to the filesystem."

  option :brew,
    :short => "-b", :long  => "--brew", :boolean => true, :default => false,
    :description => "Customize for Brew. Use with --ruby-lib."

  option :dir,
    :short => "-d DIR", :long  => "--dir DIR", :default => nil,
    :description => "The directory to dump files into. Use with --ruby-lib. Defaults to cwd."

  option :help, :short => "-h", :long => "--help", :boolean => true,
    :description => "Show this message",
    :on => :tail,
    :show_options => true,
    :exit => 0
end

Instance Method Details

#parse(argv = ARGV) { ... } ⇒ Object

Yields:

  • Some block to yield



39
40
41
42
# File 'lib/plist4r/cli.rb', line 39

def parse argv=ARGV
  parse_options(argv)
  config
end