mixlib-cli 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -0
- data/VERSION.yml +1 -1
- data/lib/mixlib/cli.rb +1 -0
- data/spec/mixlib/cli_spec.rb +15 -0
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -72,4 +72,8 @@ Available arguments to 'option':
|
|
72
72
|
:exit:: Exit your program with the exit code when this option is specified. Example: 0
|
73
73
|
:proc:: If set, the configuration value will be set to the return value of this proc.
|
74
74
|
|
75
|
+
=== New in 1.2.0
|
76
|
+
|
77
|
+
We no longer destructively manipulate ARGV.
|
78
|
+
|
75
79
|
Have fun!
|
data/VERSION.yml
CHANGED
data/lib/mixlib/cli.rb
CHANGED
data/spec/mixlib/cli_spec.rb
CHANGED
@@ -168,6 +168,21 @@ describe Mixlib::CLI do
|
|
168
168
|
lambda { @cli.parse_options([]) }.should raise_error(SystemExit)
|
169
169
|
end
|
170
170
|
|
171
|
+
it "should preserve all of the commandline arguments, ARGV" do
|
172
|
+
TestCLI.option(:config_file, :short => "-c CONFIG")
|
173
|
+
@cli = TestCLI.new
|
174
|
+
argv_old = ARGV.dup
|
175
|
+
ARGV.replace ['-c','foo.rb']
|
176
|
+
@cli.parse_options()
|
177
|
+
ARGV.should == ['-c','foo.rb']
|
178
|
+
ARGV.replace argv_old
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should return any un-parsed elements" do
|
182
|
+
TestCLI.option(:party, :short => "-p LOCATION")
|
183
|
+
@cli = TestCLI.new
|
184
|
+
@cli.parse_options([ '-p', 'opscode', 'hard' ]).should == ['hard']
|
185
|
+
end
|
171
186
|
end
|
172
187
|
end
|
173
188
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 1.
|
9
|
+
version: 1.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Opscode, Inc.
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-03-31 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|