clasp-ruby 0.22.1 → 0.23.0.2

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -52
  3. data/examples/cr-example.rb +16 -16
  4. data/examples/flag_and_option_specifications.md +25 -25
  5. data/examples/flag_and_option_specifications.rb +6 -6
  6. data/examples/show_usage_and_version.md +5 -5
  7. data/examples/show_usage_and_version.rb +1 -1
  8. data/examples/simple_command_line_no_specifications.rb +1 -1
  9. data/lib/clasp/arguments.rb +543 -531
  10. data/lib/clasp/clasp.rb +7 -7
  11. data/lib/clasp/cli.rb +140 -135
  12. data/lib/clasp/doc_.rb +3 -3
  13. data/lib/clasp/old_module.rb +3 -3
  14. data/lib/clasp/specifications.rb +337 -333
  15. data/lib/clasp/util/exceptions.rb +17 -17
  16. data/lib/clasp/util/value_parser.rb +97 -97
  17. data/lib/clasp/version.rb +15 -15
  18. data/lib/clasp-ruby.rb +3 -2
  19. data/lib/clasp.rb +3 -2
  20. data/test/scratch/test_list_command_line.rb +6 -6
  21. data/test/scratch/test_specifications.rb +14 -14
  22. data/test/scratch/test_usage.rb +6 -6
  23. data/test/scratch/test_usage_from_DATA.rb +1 -1
  24. data/test/scratch/test_usage_with_duplicate_specifications.rb +6 -6
  25. data/test/unit/tc_ARGV_rewrite.rb +36 -38
  26. data/test/unit/tc_arguments_1.rb +702 -656
  27. data/test/unit/tc_arguments_2.rb +52 -53
  28. data/test/unit/tc_arguments_3.rb +77 -77
  29. data/test/unit/tc_arguments_inspect.rb +55 -56
  30. data/test/unit/tc_cli.rb +4 -4
  31. data/test/unit/tc_default_value.rb +91 -91
  32. data/test/unit/tc_defaults_1.rb +38 -38
  33. data/test/unit/tc_examples_Arguments.rb +130 -132
  34. data/test/unit/tc_extras.rb +24 -26
  35. data/test/unit/tc_option_required.rb +38 -39
  36. data/test/unit/tc_option_value_aliases.rb +44 -44
  37. data/test/unit/tc_specifications.rb +7 -8
  38. data/test/unit/tc_typed_options.rb +204 -204
  39. data/test/unit/tc_usage.rb +112 -55
  40. data/test/unit/tc_with_action.rb +23 -24
  41. data/test/unit/ts_all.rb +1 -1
  42. metadata +8 -7
@@ -5,13 +5,13 @@
5
5
  # Purpose: Exception classes
6
6
  #
7
7
  # Created: 20th April 2019
8
- # Updated: 28th April 2019
8
+ # Updated: 20th January 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/CLASP.Ruby
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019, Matthew Wilson and Synesis Software
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Software
15
15
  # All rights reserved.
16
16
  #
17
17
  # Redistribution and use in source and binary forms, with or without
@@ -53,30 +53,30 @@ module CLASP # :nodoc:
53
53
  # Exceptions
54
54
  module Exceptions
55
55
 
56
- # Root exception for CLASP
57
- class CLASPException < RuntimeError; end
56
+ # Root exception for CLASP
57
+ class CLASPException < RuntimeError; end
58
58
 
59
- # Root exception for value parsing
60
- class ValueParserException < CLASPException; end
59
+ # Root exception for value parsing
60
+ class ValueParserException < CLASPException; end
61
61
 
62
- # No value specified (and no default value) for an option
63
- class MissingValueException < ValueParserException; end
62
+ # No value specified (and no default value) for an option
63
+ class MissingValueException < ValueParserException; end
64
64
 
65
- # Exception class indicating invalid values (as opposed to types)
66
- class InvalidValueException < ValueParserException; end
65
+ # Exception class indicating invalid values (as opposed to types)
66
+ class InvalidValueException < ValueParserException; end
67
67
 
68
- # The given value could not be recognised as a (properly-formatted) number
69
- class InvalidNumberException < InvalidValueException; end
68
+ # The given value could not be recognised as a (properly-formatted) number
69
+ class InvalidNumberException < InvalidValueException; end
70
70
 
71
- # The given value could not be recognised as a (properly-formatted) integer
72
- class InvalidIntegerException < InvalidNumberException; end
71
+ # The given value could not be recognised as a (properly-formatted) integer
72
+ class InvalidIntegerException < InvalidNumberException; end
73
73
 
74
- # The value was a valid integer but is out of range
75
- class IntegerOutOfRangeException < InvalidValueException; end
74
+ # The value was a valid integer but is out of range
75
+ class IntegerOutOfRangeException < InvalidValueException; end
76
76
 
77
77
  end # module Exceptions
78
78
  end # module CLASP
79
79
 
80
- # ############################## end of file ############################# #
81
80
 
81
+ # ############################## end of file ############################# #
82
82
 
@@ -5,13 +5,13 @@
5
5
  # Purpose: Utility component for typed values
6
6
  #
7
7
  # Created: 20th April 2019
8
- # Updated: 28th April 2019
8
+ # Updated: 20th January 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/CLASP.Ruby
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019, Matthew Wilson and Synesis Software
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Software
15
15
  # All rights reserved.
16
16
  #
17
17
  # Redistribution and use in source and binary forms, with or without
@@ -56,167 +56,167 @@ module Util # :nodoc:
56
56
  # @!visibility private
57
57
  module ValueParser # :nodoc: all
58
58
 
59
- module Internal_ # :nodoc: all
59
+ module Internal_ # :nodoc: all
60
60
 
61
- include Exceptions
61
+ include Exceptions
62
62
 
63
- def self.is_integer? type
63
+ def self.is_integer? type
64
64
 
65
- h = {}
65
+ h = {}
66
66
 
67
- return true if Integer == type
68
- return true if :integer == type
67
+ return true if Integer == type
68
+ return true if :integer == type
69
69
 
70
- false
71
- end
70
+ false
71
+ end
72
72
 
73
- def self.obtain_integer value, constraint, argument_spec
73
+ def self.obtain_integer value, constraint, argument_spec
74
74
 
75
- # If no value is given, then use the default (and don't do any
76
- # range testing)
75
+ # If no value is given, then use the default (and don't do any
76
+ # range testing)
77
77
 
78
- if (value || '').empty?
78
+ if (value || '').empty?
79
79
 
80
- def_value = argument_spec.default_value
80
+ def_value = argument_spec.default_value
81
81
 
82
- if (def_value || '').to_s.empty?
82
+ if (def_value || '').to_s.empty?
83
83
 
84
- msg = "no value specified for the option '#{argument_spec.name}', which has no default value either"
84
+ msg = "no value specified for the option '#{argument_spec.name}', which has no default value either"
85
85
 
86
- warn msg if $DEBUG
86
+ warn msg if $DEBUG
87
87
 
88
- raise MissingValueException, msg
89
- end
88
+ raise MissingValueException, msg
89
+ end
90
90
 
91
- begin
91
+ begin
92
92
 
93
- return Integer(def_value)
94
- rescue ArgumentError => x
93
+ return Integer(def_value)
94
+ rescue ArgumentError => x
95
95
 
96
- msg = "default value '#{def_value}' specified for option '#{argument_spec.name}' that requires the value to be an integer"
96
+ msg = "default value '#{def_value}' specified for option '#{argument_spec.name}' that requires the value to be an integer"
97
97
 
98
- warn msg if $DEBUG
98
+ warn msg if $DEBUG
99
99
 
100
- raise InvalidIntegerException, msg
101
- end
102
- end
100
+ raise InvalidIntegerException, msg
101
+ end
102
+ end
103
103
 
104
- # obtain the integer from the value
104
+ # obtain the integer from the value
105
105
 
106
- v = nil
106
+ v = nil
107
107
 
108
- begin
108
+ begin
109
109
 
110
- v = Integer(value)
111
- rescue ArgumentError => x
110
+ v = Integer(value)
111
+ rescue ArgumentError => x
112
112
 
113
- msg = "value '#{value}' specified for option '#{argument_spec.name}' that requires the value to be an integer"
113
+ msg = "value '#{value}' specified for option '#{argument_spec.name}' that requires the value to be an integer"
114
114
 
115
- warn msg if $DEBUG
115
+ warn msg if $DEBUG
116
116
 
117
- raise InvalidIntegerException, msg
118
- end
117
+ raise InvalidIntegerException, msg
118
+ end
119
119
 
120
- # Is there a value constraint?:
121
- #
122
- # - values (obtained from argument_spec#values)
123
- # - range
124
- # - minimum & maximum
120
+ # Is there a value constraint?:
121
+ #
122
+ # - values (obtained from argument_spec#values)
123
+ # - range
124
+ # - minimum & maximum
125
125
 
126
- values_range = argument_spec.values_range
126
+ values_range = argument_spec.values_range
127
127
 
128
- unless values_range.empty?
128
+ unless values_range.empty?
129
129
 
130
- v_s = v.to_s
130
+ v_s = v.to_s
131
131
 
132
- v_s = '+' + v_s unless '-' == v_s[0]
132
+ v_s = '+' + v_s unless '-' == v_s[0]
133
133
 
134
- vr_s = values_range.map { |x| x.to_s }.map { |x| '-' == x[0] ? x : '+' + x }
134
+ vr_s = values_range.map { |x| x.to_s }.map { |x| '-' == x[0] ? x : '+' + x }
135
135
 
136
- unless vr_s.include? v_s
136
+ unless vr_s.include? v_s
137
137
 
138
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' does not fall within the required range"
138
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' does not fall within the required range"
139
139
 
140
- raise IntegerOutOfRangeException, msg
141
- end
142
- else
140
+ raise IntegerOutOfRangeException, msg
141
+ end
142
+ else
143
143
 
144
- case range = constraint[:range]
145
- when :negative
144
+ case range = constraint[:range]
145
+ when :negative
146
146
 
147
- if v >= 0
147
+ if v >= 0
148
148
 
149
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a negative integer"
149
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a negative integer"
150
150
 
151
- raise IntegerOutOfRangeException, msg
152
- end
153
- when :positive
151
+ raise IntegerOutOfRangeException, msg
152
+ end
153
+ when :positive
154
154
 
155
- if v < 1
155
+ if v < 1
156
156
 
157
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a positive integer"
157
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a positive integer"
158
158
 
159
- raise IntegerOutOfRangeException, msg
160
- end
161
- when :non_positive
159
+ raise IntegerOutOfRangeException, msg
160
+ end
161
+ when :non_positive
162
162
 
163
- if v > 0
163
+ if v > 0
164
164
 
165
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a non-positive integer"
165
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a non-positive integer"
166
166
 
167
- raise IntegerOutOfRangeException, msg
168
- end
169
- when :non_negative
167
+ raise IntegerOutOfRangeException, msg
168
+ end
169
+ when :non_negative
170
170
 
171
- if v < 0
171
+ if v < 0
172
172
 
173
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a non-negative integer"
173
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' must be a non-negative integer"
174
174
 
175
- raise IntegerOutOfRangeException, msg
176
- end
177
- when Range
175
+ raise IntegerOutOfRangeException, msg
176
+ end
177
+ when Range
178
178
 
179
- unless range.include?
179
+ unless range.include?
180
180
 
181
- msg = "given value '#{value}' specified for option '#{argument_spec.name}' does not fall within the required range"
181
+ msg = "given value '#{value}' specified for option '#{argument_spec.name}' does not fall within the required range"
182
182
 
183
- raise IntegerOutOfRangeException, msg
184
- end
185
- else
183
+ raise IntegerOutOfRangeException, msg
184
+ end
185
+ else
186
186
 
187
- ;
188
- end
189
- end
187
+ ;
188
+ end
189
+ end
190
190
 
191
- v
192
- end
193
- end # module Internal_
191
+ v
192
+ end
193
+ end # module Internal_
194
194
 
195
- def value_from_Proc(constraint, value, arg, given_index, given_name, argument_spec, extras)
195
+ def value_from_Proc(constraint, value, arg, given_index, given_name, argument_spec, extras)
196
196
 
197
- value
198
- end
197
+ value
198
+ end
199
199
 
200
- def value_from_Hash(constraint, value, arg, given_index, given_name, argument_spec, extras)
200
+ def value_from_Hash(constraint, value, arg, given_index, given_name, argument_spec, extras)
201
201
 
202
- # Check if type is specified; if not, String is assumed
202
+ # Check if type is specified; if not, String is assumed
203
203
 
204
- type = constraint[:type]
204
+ type = constraint[:type]
205
205
 
206
206
 
207
- if Internal_.is_integer?(type)
207
+ if Internal_.is_integer?(type)
208
208
 
209
- return Internal_.obtain_integer(value, constraint, argument_spec)
210
- end
209
+ return Internal_.obtain_integer(value, constraint, argument_spec)
210
+ end
211
211
 
212
212
 
213
- value
214
- end
213
+ value
214
+ end
215
215
  end # module ValueParser
216
216
 
217
217
  end # module util
218
218
  end # module CLASP
219
219
 
220
- # ############################## end of file ############################# #
221
220
 
221
+ # ############################## end of file ############################# #
222
222
 
data/lib/clasp/version.rb CHANGED
@@ -5,13 +5,13 @@
5
5
  # Purpose: Version for CLASP.Ruby library
6
6
  #
7
7
  # Created: 16th November 2014
8
- # Updated: 26th June 2022
8
+ # Updated: 20th January 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/CLASP.Ruby
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019-2022, Matthew Wilson and Synesis Information Systems
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2014-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -51,22 +51,22 @@
51
51
 
52
52
  module CLASP
53
53
 
54
- # Current version of the CLASP.Ruby library
55
- VERSION = '0.22.1'
54
+ # Current version of the CLASP.Ruby library
55
+ VERSION = '0.23.0.2'
56
56
 
57
- private
58
- # @!visibility private
59
- VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
60
- public
61
- # Major version of the CLASP.Ruby library
62
- VERSION_MAJOR = VERSION_PARTS_[0] # :nodoc:
63
- # Minor version of the CLASP.Ruby library
64
- VERSION_MINOR = VERSION_PARTS_[1] # :nodoc:
65
- # Revision version of the CLASP.Ruby library
66
- VERSION_REVISION = VERSION_PARTS_[2] # :nodoc:
57
+ private
58
+ # @!visibility private
59
+ VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
60
+ public
61
+ # Major version of the CLASP.Ruby library
62
+ VERSION_MAJOR = VERSION_PARTS_[0] # :nodoc:
63
+ # Minor version of the CLASP.Ruby library
64
+ VERSION_MINOR = VERSION_PARTS_[1] # :nodoc:
65
+ # Revision version of the CLASP.Ruby library
66
+ VERSION_REVISION = VERSION_PARTS_[2] # :nodoc:
67
67
 
68
68
  end # module CLASP
69
69
 
70
- # ############################## end of file ############################# #
71
70
 
71
+ # ############################## end of file ############################# #
72
72
 
data/lib/clasp-ruby.rb CHANGED
@@ -5,13 +5,13 @@
5
5
  # Purpose: Top-level source for CLASP.ruby library [alternate]
6
6
  #
7
7
  # Created: 13th October 2014
8
- # Updated: 10th June 2016
8
+ # Updated: 20th January 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/CLASP.Ruby
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2014-2016, Matthew Wilson and Synesis Software
14
+ # Copyright (c) 2014-2024, Matthew Wilson and Synesis Software
15
15
  # All rights reserved.
16
16
  #
17
17
  # Redistribution and use in source and binary forms, with or without
@@ -47,5 +47,6 @@
47
47
  # clasp-ruby.rb -> clasp/clasp.rb
48
48
  require 'clasp/clasp'
49
49
 
50
+
50
51
  # ############################## end of file ############################# #
51
52
 
data/lib/clasp.rb CHANGED
@@ -5,13 +5,13 @@
5
5
  # Purpose: Top-level source for CLASP.ruby library
6
6
  #
7
7
  # Created: 13th October 2014
8
- # Updated: 10th June 2016
8
+ # Updated: 20th January 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/CLASP.Ruby
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2014-2016, Matthew Wilson and Synesis Software
14
+ # Copyright (c) 2014-2024, Matthew Wilson and Synesis Software
15
15
  # All rights reserved.
16
16
  #
17
17
  # Redistribution and use in source and binary forms, with or without
@@ -47,5 +47,6 @@
47
47
  # clasp.rb -> clasp/clasp.rb
48
48
  require 'clasp/clasp'
49
49
 
50
+
50
51
  # ############################## end of file ############################# #
51
52
 
@@ -6,10 +6,10 @@ require 'clasp'
6
6
 
7
7
  Specifications = [
8
8
 
9
- CLASP.Flag('--help', help: 'shows this help and quits'),
10
- CLASP.Flag('--version', alias: '-v', help: 'shows this version and quits'),
9
+ CLASP.Flag('--help', help: 'shows this help and quits'),
10
+ CLASP.Flag('--version', alias: '-v', help: 'shows this version and quits'),
11
11
 
12
- CLASP.Option('--verbosity', aliases: %w{ -V --verbose }),
12
+ CLASP.Option('--verbosity', aliases: %w{ -V --verbose }),
13
13
  ]
14
14
 
15
15
  Args = CLASP::Arguments.new(ARGV, Specifications)
@@ -18,20 +18,20 @@ puts
18
18
  puts "flags #{Args.flags.size}:"
19
19
  Args.flags.each do |flag|
20
20
 
21
- puts "\t#{flag}\t[#{flag.given_index}, #{flag.given_name}, #{flag.argument_specification}, #{flag.given_hyphens}, #{flag.given_label}, #{flag.name}]"
21
+ puts "\t#{flag}\t[#{flag.given_index}, #{flag.given_name}, #{flag.argument_specification}, #{flag.given_hyphens}, #{flag.given_label}, #{flag.name}]"
22
22
  end
23
23
 
24
24
  puts
25
25
  puts "options #{Args.options.size}:"
26
26
  Args.options.each do |option|
27
27
 
28
- puts "\t#{option}\t[#{option.given_index}, #{option.given_name}, #{option.argument_specification}, #{option.given_hyphens}, #{option.given_label}, #{option.name}, #{option.value}]"
28
+ puts "\t#{option}\t[#{option.given_index}, #{option.given_name}, #{option.argument_specification}, #{option.given_hyphens}, #{option.given_label}, #{option.name}, #{option.value}]"
29
29
  end
30
30
 
31
31
  puts
32
32
  puts "values #{Args.values.size}:"
33
33
  Args.values.each do |value|
34
34
 
35
- puts "\t#{value}"
35
+ puts "\t#{value}"
36
36
  end
37
37
 
@@ -6,34 +6,34 @@ require 'clasp'
6
6
 
7
7
  Specifications = [
8
8
 
9
- CLASP.Flag('--help', help: 'shows this help and quits'),
10
- CLASP.Flag('--version', alias: '-v', help: 'shows this version and quits'),
11
- CLASP.Alias('--version', aliases: [ '-ver', '-V' ]),
9
+ CLASP.Flag('--help', help: 'shows this help and quits'),
10
+ CLASP.Flag('--version', alias: '-v', help: 'shows this version and quits'),
11
+ CLASP.Alias('--version', aliases: [ '-ver', '-V' ]),
12
12
 
13
- CLASP.Option('--directory', alias: '-d', help: 'a directory within which to process'),
14
- CLASP.Option('--patterns', alias: '-p', help: "one or more patterns against which the entries will be matched, separated by '|' or the platform-specific separator - ':' UNIX, ';' Windows"),
13
+ CLASP.Option('--directory', alias: '-d', help: 'a directory within which to process'),
14
+ CLASP.Option('--patterns', alias: '-p', help: "one or more patterns against which the entries will be matched, separated by '|' or the platform-specific separator - ':' UNIX, ';' Windows"),
15
15
 
16
- CLASP.Option('--case-sensitive', alias: '-c', help: 'determines whether case sensitive', values_range: %W{ yes no true false }, default_value: false),
17
- CLASP.Alias('--case-sensitive=false', alias: '-I'),
16
+ CLASP.Option('--case-sensitive', alias: '-c', help: 'determines whether case sensitive', values_range: %W{ yes no true false }, default_value: false),
17
+ CLASP.Alias('--case-sensitive=false', alias: '-I'),
18
18
  ]
19
19
 
20
- Arguments = CLASP::Arguments.new(ARGV, Specifications)
21
- Flags = Arguments.flags
22
- Options = Arguments.options
23
- Values = Arguments.values
20
+ Arguments = CLASP::Arguments.new(ARGV, Specifications)
21
+ Flags = Arguments.flags
22
+ Options = Arguments.options
23
+ Values = Arguments.values
24
24
 
25
25
  if Flags.include? '--help'
26
26
 
27
- CLASP.show_usage Specifications, exit: 0
27
+ CLASP.show_usage Specifications, exit: 0
28
28
  end
29
29
 
30
30
  Flags.each do |f|
31
31
 
32
- puts f.inspect
32
+ puts f.inspect
33
33
  end
34
34
 
35
35
  Options.each do |o|
36
36
 
37
- puts o.inspect
37
+ puts o.inspect
38
38
  end
39
39
 
@@ -6,15 +6,15 @@ require 'clasp'
6
6
 
7
7
  Specifications = [
8
8
 
9
- CLASP.Flag('--version', alias: '-v', help: 'shows the program version and quits'),
9
+ CLASP.Flag('--version', alias: '-v', help: 'shows the program version and quits'),
10
10
 
11
- CLASP.Option('--verbosity', help: 'the verbosity', values: [ 'silent', 'quiet', 'succinct', 'chatty', 'verbose' ]),
12
- CLASP.Option('--length', alias: '-l', help: 'specifies the length'),
13
- CLASP.Flag('--verbosity=succinct', aliases: [ '--succinct', '-s' ]),
14
- CLASP.Flag('--verbosity=verbose', alias: '--verbose'),
11
+ CLASP.Option('--verbosity', help: 'the verbosity', values: [ 'silent', 'quiet', 'succinct', 'chatty', 'verbose' ]),
12
+ CLASP.Option('--length', alias: '-l', help: 'specifies the length'),
13
+ CLASP.Flag('--verbosity=succinct', aliases: [ '--succinct', '-s' ]),
14
+ CLASP.Flag('--verbosity=verbose', alias: '--verbose'),
15
15
  ]
16
16
 
17
- Arguments = CLASP::Arguments.new(ARGV, Specifications)
17
+ Arguments = CLASP::Arguments.new(ARGV, Specifications)
18
18
 
19
19
  puts
20
20
  puts '*' * 40
@@ -4,7 +4,7 @@ $:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
4
4
 
5
5
  require 'clasp'
6
6
 
7
- Arguments = CLASP::Arguments.load(ARGV, DATA)
7
+ Arguments = CLASP::Arguments.load(ARGV, DATA)
8
8
 
9
9
  puts
10
10
  puts '*' * 40
@@ -6,15 +6,15 @@ require 'clasp'
6
6
 
7
7
  Specifications = [
8
8
 
9
- CLASP.Flag('--version', alias: '-v', help: 'shows the program version and quits'),
9
+ CLASP.Flag('--version', alias: '-v', help: 'shows the program version and quits'),
10
10
 
11
- CLASP.Option('--verbosity', help: 'the verbosity', values: [ 'silent', 'quiet', 'succinct', 'chatty', 'verbose' ]),
12
- CLASP.Option('--length', alias: '-l', help: 'specifies the length'),
13
- CLASP.Flag('--verbosity=succinct', aliases: [ '--succinct', '-s' ]),
14
- CLASP.Flag('--verbosity=verbose', aliases: [ '--verbose', '-v' ]),
11
+ CLASP.Option('--verbosity', help: 'the verbosity', values: [ 'silent', 'quiet', 'succinct', 'chatty', 'verbose' ]),
12
+ CLASP.Option('--length', alias: '-l', help: 'specifies the length'),
13
+ CLASP.Flag('--verbosity=succinct', aliases: [ '--succinct', '-s' ]),
14
+ CLASP.Flag('--verbosity=verbose', aliases: [ '--verbose', '-v' ]),
15
15
  ]
16
16
 
17
- Arguments = CLASP::Arguments.new(ARGV, Specifications)
17
+ Arguments = CLASP::Arguments.new(ARGV, Specifications)
18
18
 
19
19
  puts
20
20
  puts '*' * 40