Class: Plist4r::CLI

Includes:
Mixlib::CLI
Defined in:
lib/plist4r/cli.rb

Class Methods

Instance Methods

Methods included from Mixlib::CLI

#build_option_arguments, #initialize, #parse_options

Overview

Defines options for the plist4r command line utility

Constructor Details

This class inherits a constructor from Plist4r::Mixlib::CLI

Class Method Details

+ (Object) plist4r_cli_options

The Plist4r CLI Options

Examples:

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

- (Object) parse(argv = ARGV) { ... }

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