getopt-declare 1.21 → 1.22
Sign up to get free protection for your applications and to get access to all the features.
- data/Declare.rdoc +2 -2
- data/HISTORY.txt +4 -0
- data/Rakefile +1 -1
- data/lib/Getopt/Declare.rb +5 -5
- data/samples/cmdline_basic.rb +1 -1
- data/samples/cmdline_code.rb +1 -1
- data/samples/cmdline_defer.rb +1 -1
- data/samples/cmdline_file.rb +1 -1
- data/samples/cmdline_finish.rb +1 -1
- data/samples/cmdline_inlines.rb +1 -1
- data/samples/cmdline_mid.rb +1 -1
- data/samples/cmdline_parameters.rb +1 -1
- data/samples/cmdline_pvtype.rb +1 -1
- data/samples/cmdline_pvtype2.rb +1 -1
- data/samples/cmdline_regex.rb +1 -1
- data/samples/demo_cmdline.rb +1 -1
- data/samples/demo_csv.rb +1 -1
- data/samples/demo_interp.rb +1 -1
- metadata +3 -3
data/Declare.rdoc
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
#
|
6
6
|
# = VERSION
|
7
7
|
#
|
8
|
-
# This document describes version 1.
|
9
|
-
# Released Jan
|
8
|
+
# This document describes version 1.22 of Getopt::Declare,
|
9
|
+
# Released Jan 21, 2007 for Ruby.
|
10
10
|
#
|
11
11
|
# Original Perl's Getopt-Declare v1.09, Released May 21, 1999.
|
12
12
|
#
|
data/HISTORY.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
1.22 - * Fixed some nasty bugs introduced in 1.21, which would cause stack
|
2
|
+
traces.
|
3
|
+
* Fixed the use of /bin/env in some demos instead of /usr/bin/env.
|
4
|
+
|
1
5
|
1.21 - Incorporated Perl fixes done by Damian in v1.10 and v1.11 of the
|
2
6
|
corresponding Getopt-Declare into Ruby.
|
3
7
|
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ rdoc_files = ["Declare.rdoc", 'HISTORY.txt'] + Dir.glob('lib/*/*.rb')
|
|
10
10
|
#
|
11
11
|
spec = Gem::Specification.new do |spec|
|
12
12
|
spec.name = "getopt-declare"
|
13
|
-
spec.version = '1.
|
13
|
+
spec.version = '1.22'
|
14
14
|
spec.author = "Gonzalo Garramuno"
|
15
15
|
spec.email = 'ggarra@advancedsl.com.ar, GGarramuno@aol.com'
|
16
16
|
spec.homepage = 'http://www.rubyforge.org/projects/getoptdeclare/'
|
data/lib/Getopt/Declare.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Ruby port of Perl's Getopt::Declare, version 1.21,
|
5
5
|
# released May 21, 1999.
|
6
6
|
#
|
7
|
-
# $Release Version: 1.
|
7
|
+
# $Release Version: 1.22 $
|
8
8
|
# $Date: 2007/01/15 10:53:09 $
|
9
9
|
# by Gonzalo Garramu�o
|
10
10
|
#
|
@@ -70,7 +70,7 @@ module Getopt
|
|
70
70
|
# Main Class
|
71
71
|
class Declare
|
72
72
|
|
73
|
-
VERSION = '1.
|
73
|
+
VERSION = '1.22'
|
74
74
|
|
75
75
|
# For debugging, use [debug] and it will output the ruby code as .CODE.rb
|
76
76
|
@@debug = false
|
@@ -519,7 +519,7 @@ EOS
|
|
519
519
|
|
520
520
|
|
521
521
|
@@nextid += 1
|
522
|
-
@flag =
|
522
|
+
@flag = ''
|
523
523
|
@foundid = nil
|
524
524
|
@args = []
|
525
525
|
@actions = []
|
@@ -613,7 +613,7 @@ EOS
|
|
613
613
|
nocasei = ((Getopt::Declare::nocase || @nocase) ? 'i' : '')
|
614
614
|
|
615
615
|
code << " catch(:paramout) do\n"
|
616
|
-
code += !@repeatable? " while !_FOUND_['" +
|
616
|
+
code += !@repeatable? " while !_FOUND_['" + self.foundid + "']" :
|
617
617
|
" while 1"
|
618
618
|
if (flag && (clump==1 && flag !~ /\A[^a-z0-9]+[a-z0-9]\Z/i ||
|
619
619
|
(clump<3 && @args )))
|
@@ -741,7 +741,7 @@ EOS
|
|
741
741
|
|
742
742
|
# Return name of argument, which can be flag's name or variable's name
|
743
743
|
def name
|
744
|
-
return @flag
|
744
|
+
return ( @flag.empty? ? "<#{@args[0].name}>" : @flag )
|
745
745
|
end
|
746
746
|
|
747
747
|
# Return foundid of argument, which can be flag's name or variable's name
|
data/samples/cmdline_basic.rb
CHANGED
data/samples/cmdline_code.rb
CHANGED
data/samples/cmdline_defer.rb
CHANGED
data/samples/cmdline_file.rb
CHANGED
data/samples/cmdline_finish.rb
CHANGED
data/samples/cmdline_inlines.rb
CHANGED
data/samples/cmdline_mid.rb
CHANGED
data/samples/cmdline_pvtype.rb
CHANGED
data/samples/cmdline_pvtype2.rb
CHANGED
data/samples/cmdline_regex.rb
CHANGED
data/samples/demo_cmdline.rb
CHANGED
data/samples/demo_csv.rb
CHANGED
data/samples/demo_interp.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.1
|
3
3
|
specification_version: 1
|
4
4
|
name: getopt-declare
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "1.
|
7
|
-
date: 2007-01-
|
6
|
+
version: "1.22"
|
7
|
+
date: 2007-01-21 00:00:00 -03:00
|
8
8
|
summary: Getopt-Declare is a command-line argument parser.
|
9
9
|
require_paths:
|
10
10
|
- lib
|