summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-09-18 11:48:04 -0700
committerTim Smith <tsmith@chef.io>2018-09-18 11:48:04 -0700
commit1b9517077607624cdf71f89f9b6308f54269f31c (patch)
tree099b571905fc5b2cb3ec2652744dc879cc4751b2 /README.md
parent2fb4b76c749da66ec3d9adedf6a305fbc2cced97 (diff)
downloadmixlib-cli-1b9517077607624cdf71f89f9b6308f54269f31c.tar.gz
Lint the example code
Remove Ruby 1.8 style hashes Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'README.md')
-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