gli 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,12 +8,6 @@ This is a DSL you can use to create a command line interface like git, gem or sv
8
8
 
9
9
  == Use
10
10
 
11
- Note that the latest version of this gem is hosted at [http://www.gemcutter.org], so if you haven't set it up yet, do so:
12
-
13
- # Only needed if you haven't used/setup Gemcutter before
14
- sudo gem install gemcutter
15
- sudo gem tumble
16
-
17
11
  Install if you need to:
18
12
 
19
13
  sudo gem install gli
@@ -129,12 +123,14 @@ What this gives you:
129
123
  * Error handling when flags do not receive arguments or unknown flags or switches are given
130
124
  * Error handling when an unknown command is specified
131
125
  * Default values for flags if they are not specified by the user (switches all default to false)
126
+ * An easy way to allow location-specific defaults for options via a config file for your app
132
127
 
133
128
  What this doesn't give you:
134
129
 
135
130
  * A way to indicate required flags
136
131
  * A way to indicate a required argument or required number of arguments
137
132
  * A way to do default switches to 'true' and therefore accept things like <tt>--no-force</tt>
133
+ * A way to have repeated flags turn into an array or other type-transforming things
138
134
 
139
135
  == Configuration File
140
136
 
data/lib/gli.rb CHANGED
@@ -3,6 +3,7 @@ require 'gli/command.rb'
3
3
  require 'gli/switch.rb'
4
4
  require 'gli/flag.rb'
5
5
  require 'gli/options.rb'
6
+ require 'gli_version.rb'
6
7
  require 'support/help.rb'
7
8
  require 'support/rdoc.rb'
8
9
  require 'support/initconfig.rb'
@@ -14,8 +15,6 @@ require 'etc'
14
15
  module GLI
15
16
  extend self
16
17
 
17
- VERSION = '1.0.0'
18
-
19
18
  @@program_name = $0.split(/\//)[-1]
20
19
  @@post_block = nil
21
20
  @@pre_block = nil
@@ -256,7 +255,7 @@ module GLI
256
255
 
257
256
  flag_hash.each do |name,flag|
258
257
  value = flag.get_value!(try_me)
259
- options[name] = value if !options[name]
258
+ options[name] = value if value
260
259
  end
261
260
 
262
261
  if try_me.empty?
@@ -0,0 +1,3 @@
1
+ module GLI
2
+ VERSION = '1.1.1'
3
+ end
@@ -8,7 +8,7 @@ module GLI
8
8
 
9
9
  def initialize(config_file_name)
10
10
  @filename = config_file_name
11
- super(:initconfig,"Initialize the config file using current global options",nil,'Initializes a configuration file where you can set default options for command line flags, but globally and on a per-command basis. These defaults override the built-in defaults and allow you to omit commonly-used command line flags when invoking this program')
11
+ super(:initconfig,"Initialize the config file using current global options",nil,'Initializes a configuration file where you can set default options for command line flags, both globally and on a per-command basis. These defaults override the built-in defaults and allow you to omit commonly-used command line flags when invoking this program')
12
12
 
13
13
  self.desc 'force overwrite of existing config file'
14
14
  self.switch :force
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Copeland
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-24 00:00:00 -05:00
12
+ date: 2010-06-12 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -29,6 +29,7 @@ files:
29
29
  - lib/gli/switch.rb
30
30
  - lib/gli/options.rb
31
31
  - lib/gli.rb
32
+ - lib/gli_version.rb
32
33
  - lib/support/help.rb
33
34
  - lib/support/rdoc.rb
34
35
  - lib/support/scaffold.rb