diff options
author | Tim Smith <tsmith@chef.io> | 2018-09-18 11:52:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 11:52:02 -0700 |
commit | 2fd71d079fab289fee978df836c78181863bb7ac (patch) | |
tree | 099b571905fc5b2cb3ec2652744dc879cc4751b2 | |
parent | 2fb4b76c749da66ec3d9adedf6a305fbc2cced97 (diff) | |
parent | 1b9517077607624cdf71f89f9b6308f54269f31c (diff) | |
download | mixlib-cli-2fd71d079fab289fee978df836c78181863bb7ac.tar.gz |
Merge pull request #49 from chef/examples
Lint the example code
-rw-r--r-- | README.md | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -5,33 +5,33 @@ Mixlib::CLI provides a class-based command line option parsing object, like the one used in Chef, Ohai and Relish. To use in your project: ```ruby -require 'mixlib/cli' +require "mixlib/cli" class MyCLI include Mixlib::CLI option :config_file, - :short => "-c CONFIG", - :long => "--config CONFIG", - :default => 'config.rb', - :description => "The configuration file to use" + short: "-c CONFIG", + long: "--config CONFIG", + default: "config.rb", + description: "The configuration file to use" option :log_level, - :short => "-l LEVEL", - :long => "--log_level LEVEL", - :description => "Set the log level (debug, info, warn, error, fatal)", - :required => true, - :in => [:debug, :info, :warn, :error, :fatal], - :proc => Proc.new { |l| l.to_sym } + short: "-l LEVEL", + long: "--log_level LEVEL", + description: "Set the log level (debug, info, warn, error, fatal)", + required: true, + in: [:debug, :info, :warn, :error, :fatal], + proc: Proc.new { |l| l.to_sym } option :help, - :short => "-h", - :long => "--help", - :description => "Show this message", - :on => :tail, - :boolean => true, - :show_options => true, - :exit => 0 + short: "-h", + long: "--help", + description: "Show this message", + on: :tail, + boolean: true, + show_options: true, + exit: 0 end @@ -53,7 +53,7 @@ class MyConfig end class MyCLI - def run(argv=ARGV) + def run(argv = ARGV) parse_options(argv) MyConfig.merge!(config) end |