Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -53,7 +53,7 @@ class MyConfig
end

class MyCLI
def run(argv=ARGV)
def run(argv = ARGV)
parse_options(argv)
MyConfig.merge!(config)
end
Expand Down