Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .expeditor/run_linux_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ else
fi

echo "+++ bundle exec task"
bundle exec $1
bundle exec $@
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Given the following example:

```ruby

# mycli.rb
# my_cli.rb

class MyCLI
include Mixlib::CLI
Expand Down Expand Up @@ -166,7 +166,7 @@ In this example, --dep-one will be used. Note that dep_one will not have a valu

```bash

$ ruby mycli.rb --dep-one
$ ruby my_cli.rb --dep-one

-1/--dep-one: This flag is deprecated. Use -n/--arg-not-required instead
arg_not_required: true
Expand All @@ -178,20 +178,20 @@ that --arg-required will accept,a nd populate `:arg\_required` with

```bash

$ ruby mycli.rb --dep-two z # 'q' maps to 'invalid' in the value_mapper proc above
$ ruby my_cli.rb --dep-two z # 'q' maps to 'invalid' in the value_mapper proc above

-2/--dep-two: This flag is deprecated. Use -a/--arg-required instead.

arg_required: a # The value is mapped to its replacement using the function provided.
dep_two: z # the deprected value is kept by default
dep_two: z # the deprecated value is kept by default
```

In this example, the value provided to dep-two will be converted to a value
that --arg-required will reject, showing how content rules are applied even when
the input is coming from a deprecated option:

```bash
$ ruby mycli.rb --dep-two q
$ ruby my_cli.rb --dep-two q

-2/--dep-two: This flag is deprecated. Use -a/--arg-required instead.
-a/--arg-required: invalid is not one of the allowed values: 'a', 'b', or 'c'
Expand Down
4 changes: 2 additions & 2 deletions lib/mixlib/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def option(name, args)
# and converts it to a value suitable for the new option.
# If not provided, the value provided to the deprecated option will be
# assigned directly to the converted option.
# keep<Boolean> :: Defaults to true, this ensure sthat `options[:deprecated_flag]` is
# keep<Boolean> :: Defaults to true, this ensures that `options[:deprecated_flag]` is
# populated when the deprecated flag is used. If set to false,
# only the value in `replacement` will be set. Results undefined
# if no replacement is provided. You can use this to enforce the transition
Expand Down Expand Up @@ -194,7 +194,7 @@ def options
# === Returns
# @options<Hash>:: The current options hash.
def options=(val)
raise(ArgumentError, "Options must recieve a hash") unless val.is_a?(Hash)
raise(ArgumentError, "Options must receive a hash") unless val.is_a?(Hash)

@options = val
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/cli/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.combined_option_display_name(short, long)
usage
end

# @param opt_arry [Array]
# @param opt_array [Array]
#
# @return [String] a friendly quoted list of items complete with "or"
def self.friendly_opt_list(opt_array)
Expand Down
2 changes: 1 addition & 1 deletion spec/mixlib/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
expect(@cli.config[:require_me]).to eql("")
end

it "preserves all of the commandline arguments, ARGV" do
it "preserves all of the command line arguments, ARGV" do
TestCLI.option(:config_file, short: "-c CONFIG")
@cli = TestCLI.new
argv_old = ARGV.dup
Expand Down