kerplutz 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kerplutz (0.1.0)
4
+ kerplutz (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,6 @@
1
+ == (0.1.2)
2
+ * Include command name in the results (Mike Sassak)
3
+
1
4
  == (0.1.1)
2
5
  * Favor commands when parsing ambiguous flag arguments (Mike Sassak)
3
6
 
data/README.md CHANGED
@@ -19,6 +19,7 @@ Real documentation will be forthcoming, but for now see
19
19
  ## Todo
20
20
 
21
21
  * README docs for builder and option types
22
+ * Prettify commands summary
22
23
  * Read defaults from a config file
23
24
  * Argument type-casts
24
25
  * List arguments
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'kerplutz'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.authors = ["Mike Sassak"]
5
5
  s.description = "Command-line option parser with subcommands that won't leave you feeling Kerplutz"
6
6
  s.summary = "kerplutz #{s.version}"
@@ -48,7 +48,7 @@ module Kerplutz
48
48
  end
49
49
  end
50
50
 
51
- [arguments, remainder || []]
51
+ [cmd || name, arguments, remainder || []]
52
52
  end
53
53
 
54
54
  def banner
@@ -13,9 +13,16 @@ module Kerplutz
13
13
  end
14
14
 
15
15
  describe "#parse" do
16
- it "extracts the options from the arguments" do
17
- subject.parse(["--foo"]).should == [{ :foo => true }, []]
18
- subject.parse(["--foo", "bar"]).should == [{ :foo => "bar" }, []]
16
+ it "extracts options on the base executable" do
17
+ subject.parse(["--foo"]).should == ["test", { :foo => true }, []]
18
+ end
19
+
20
+ it "extracts arguments to options on the base executable" do
21
+ subject.parse(["--foo", "bar"]).should == ["test", { :foo => "bar" }, []]
22
+ end
23
+
24
+ it "extracts arguments to subcommands" do
25
+ subject.parse(["foo", "bar", "baz"]).should == ["foo", { }, ["bar", "baz"]]
19
26
  end
20
27
 
21
28
  it "parses an unambiguous flag argument" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mike Sassak
@@ -121,7 +121,7 @@ rubyforge_project:
121
121
  rubygems_version: 1.3.7
122
122
  signing_key:
123
123
  specification_version: 3
124
- summary: kerplutz 0.1.1
124
+ summary: kerplutz 0.1.2
125
125
  test_files:
126
126
  - features/kerplutz.feature
127
127
  - features/step_definitions/kerplutz_steps.rb