summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-09-18 11:52:02 -0700
committerGitHub <noreply@github.com>2018-09-18 11:52:02 -0700
commit2fd71d079fab289fee978df836c78181863bb7ac (patch)
tree099b571905fc5b2cb3ec2652744dc879cc4751b2
parent2fb4b76c749da66ec3d9adedf6a305fbc2cced97 (diff)
parent1b9517077607624cdf71f89f9b6308f54269f31c (diff)
downloadmixlib-cli-2fd71d079fab289fee978df836c78181863bb7ac.tar.gz
Merge pull request #49 from chef/examples
Lint the example code
-rw-r--r--README.md38
1 files changed, 19 insertions, 19 deletions
diff --git a/README.md b/README.md
index 54e06bd..d6a560a 100644
--- a/README.md
+++ b/README.md
@@ -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