clasp-ruby 0.23.0.2 → 0.23.1
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.
- checksums.yaml +4 -4
- data/examples/cr-example.rb +16 -16
- data/examples/flag_and_option_specifications.rb +15 -15
- data/examples/show_usage_and_version.rb +10 -11
- data/lib/clasp/arguments.rb +86 -87
- data/lib/clasp/clasp.rb +15 -11
- data/lib/clasp/cli.rb +135 -134
- data/lib/clasp/old_module.rb +8 -8
- data/lib/clasp/specifications.rb +325 -322
- data/lib/clasp/util/exceptions.rb +21 -22
- data/lib/clasp/util/value_parser.rb +99 -101
- data/lib/clasp/version.rb +12 -12
- data/lib/clasp-ruby.rb +8 -7
- data/lib/clasp.rb +8 -7
- data/test/scratch/test_list_command_line.rb +6 -6
- data/test/scratch/test_specifications.rb +14 -14
- data/test/scratch/test_usage.rb +5 -5
- data/test/scratch/test_usage_with_duplicate_specifications.rb +5 -5
- data/test/unit/tc_ARGV_rewrite.rb +36 -36
- data/test/unit/tc_arguments_1.rb +708 -708
- data/test/unit/tc_arguments_2.rb +43 -43
- data/test/unit/tc_arguments_3.rb +77 -77
- data/test/unit/tc_arguments_inspect.rb +55 -55
- data/test/unit/tc_cli.rb +4 -4
- data/test/unit/tc_default_value.rb +91 -91
- data/test/unit/tc_defaults_1.rb +38 -38
- data/test/unit/tc_examples_Arguments.rb +130 -130
- data/test/unit/tc_extras.rb +24 -24
- data/test/unit/tc_option_required.rb +38 -38
- data/test/unit/tc_option_value_aliases.rb +44 -44
- data/test/unit/tc_specifications.rb +7 -7
- data/test/unit/tc_typed_options.rb +200 -200
- data/test/unit/tc_usage.rb +69 -69
- data/test/unit/tc_with_action.rb +23 -23
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c2f03782787016c1a8d5d2f2ef4ec5278578571f4a806e38cbaceb83ba0f0c
|
4
|
+
data.tar.gz: 6e6c1f2fadf64a6afd4a09e0126663f2526bcf1b56e3f311cc3e7d91cd50990a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10a26aab12d7e303be72ef78547bbb3035820112f41bc26542370c8071dcb09e392c4c05fd60c20e9cdc915683a2efeffc828ca90e2829b0d96597f09d6d510d
|
7
|
+
data.tar.gz: 25ee3bff884c3e50385686e1d7a37a520fbc10538d716b720a4bd95528f044adc5133c35358192703ca3218681532b8b9cda8a0d84b0a7d59ed83e7877938ca6
|
data/examples/cr-example.rb
CHANGED
@@ -11,31 +11,31 @@ PROGRAM_VERSION = '0.1.2'
|
|
11
11
|
|
12
12
|
Specifications = [
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
CLASP.Flag('--all', alias: '-a', help: 'processes all item types'),
|
15
|
+
CLASP.Flag('-c', help: 'count the processed items'),
|
16
|
+
CLASP.Option('--opt1', alias: '-o', help: 'an option of some kind', values_range: %w{ val1, val2 }),
|
17
|
+
CLASP.Flag('--opt1=val1', alias: '-v'),
|
18
|
+
|
19
|
+
# see next section for why these two are here
|
20
|
+
CLASP::Flag.Help,
|
21
|
+
CLASP::Flag.Version,
|
22
22
|
]
|
23
23
|
|
24
24
|
Args = CLASP::Arguments.new(ARGV, Specifications)
|
25
25
|
|
26
26
|
Args.flags.each do |f|
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
case f.name
|
29
|
+
when CLASP::Flag.Help.name
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
CLASP.show_usage(Specifications, exit: 0, values: '<input-file> <output-file>')
|
32
|
+
when CLASP::Flag.Version.name
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
CLASP.show_version(Specifications, exit: 0, version: PROGRAM_VERSION)
|
35
|
+
when '--all'
|
36
36
|
|
37
|
-
|
38
|
-
|
37
|
+
;
|
38
|
+
end
|
39
39
|
end
|
40
40
|
|
41
41
|
puts Args.flags.size
|
@@ -12,10 +12,10 @@ ProgramVersion = [ 0, 0, 1 ]
|
|
12
12
|
|
13
13
|
InfoLines = [
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
'CLASP.Ruby examples',
|
16
|
+
:version,
|
17
|
+
"Illustrates use of CLASP.Ruby's use of flags, options, and aliases",
|
18
|
+
'',
|
19
19
|
]
|
20
20
|
|
21
21
|
# Specify specifications, parse, and checking standard flags
|
@@ -26,24 +26,24 @@ Flag_Chatty = CLASP.Flag('--verbosity=chatty', alias: '-c')
|
|
26
26
|
|
27
27
|
Specifications = [
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
Flag_Debug,
|
30
|
+
Option_Verbosity,
|
31
|
+
Flag_Chatty,
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
CLASP::FlagSpecification.Help,
|
34
|
+
CLASP::FlagSpecification.Version,
|
35
35
|
]
|
36
36
|
|
37
37
|
args = CLASP::Arguments.new ARGV, Specifications
|
38
38
|
|
39
39
|
if args.flags.include?(CLASP::FlagSpecification.Help)
|
40
40
|
|
41
|
-
|
41
|
+
CLASP.show_usage(Specifications, exit_code: 0, version: ProgramVersion, stream: $stdout, info_lines: InfoLines, default_indicator: '*default*')
|
42
42
|
end
|
43
43
|
|
44
44
|
if args.flags.include?('--version')
|
45
45
|
|
46
|
-
|
46
|
+
CLASP.show_version(Specifications, exit_code: 0, version: ProgramVersion, stream: $stdout)
|
47
47
|
end
|
48
48
|
|
49
49
|
|
@@ -51,12 +51,12 @@ end
|
|
51
51
|
|
52
52
|
if (opt = args.find_option('--verbosity'))
|
53
53
|
|
54
|
-
|
54
|
+
$stdout.puts "verbosity is specified as: #{opt.value}"
|
55
55
|
end
|
56
56
|
|
57
57
|
if args.flags.include?('--debug')
|
58
58
|
|
59
|
-
|
59
|
+
$stdout.puts 'Debug mode is specified'
|
60
60
|
end
|
61
61
|
|
62
62
|
|
@@ -65,9 +65,9 @@ end
|
|
65
65
|
|
66
66
|
if (unused = args.find_first_unknown())
|
67
67
|
|
68
|
-
|
68
|
+
$stderr.puts "#{args.program_name}: unrecognised flag/option: #{unused}"
|
69
69
|
|
70
|
-
|
70
|
+
exit 1
|
71
71
|
end
|
72
72
|
|
73
73
|
|
@@ -12,30 +12,30 @@ ProgramVersion = [ 0, 0, 1 ]
|
|
12
12
|
|
13
13
|
InfoLines = [
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
'CLASP.Ruby examples',
|
16
|
+
:version,
|
17
|
+
"Illustrates use of CLASP.Ruby's CLASP.show_usage() and CLASP.show_version() methods",
|
18
|
+
'',
|
19
19
|
]
|
20
20
|
|
21
21
|
# Specify specifications, parse, and checking standard flags
|
22
22
|
|
23
23
|
Specifications = [
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
CLASP::FlagSpecification.Help,
|
26
|
+
CLASP::FlagSpecification.Version,
|
27
27
|
]
|
28
28
|
|
29
29
|
args = CLASP::Arguments.new ARGV, Specifications
|
30
30
|
|
31
31
|
if args.flags.include?('--help')
|
32
32
|
|
33
|
-
|
33
|
+
CLASP.show_usage(Specifications, exit_code: 0, version: ProgramVersion, stream: $stdout, info_lines: InfoLines)
|
34
34
|
end
|
35
35
|
|
36
36
|
if args.flags.include?('--version')
|
37
37
|
|
38
|
-
|
38
|
+
CLASP.show_version(Specifications, exit_code: 0, version: ProgramVersion, stream: $stdout)
|
39
39
|
end
|
40
40
|
|
41
41
|
|
@@ -43,12 +43,11 @@ end
|
|
43
43
|
|
44
44
|
if (unused = args.find_first_unknown())
|
45
45
|
|
46
|
-
|
46
|
+
$stderr.puts "#{args.program_name}: unrecognised flag/option: #{unused}"
|
47
47
|
|
48
|
-
|
48
|
+
exit 1
|
49
49
|
end
|
50
50
|
|
51
51
|
|
52
52
|
$stdout.puts 'no flags specified'
|
53
53
|
|
54
|
-
|
data/lib/clasp/arguments.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: clasp/arguments.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
6
|
-
# CLASP.Ruby
|
5
|
+
# Purpose: Definition of the Arguments class, the main class in CLASP.Ruby
|
7
6
|
#
|
8
|
-
# Created:
|
9
|
-
# Updated:
|
7
|
+
# Created: 14th February 2014
|
8
|
+
# Updated: 6th March 2025
|
10
9
|
#
|
11
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/CLASP.Ruby
|
12
11
|
#
|
13
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
14
13
|
#
|
15
|
-
# Copyright (c) 2019-
|
14
|
+
# Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
|
16
15
|
# Copyright (c) 2014-2019, Matthew Wilson and Synesis Software
|
17
16
|
# All rights reserved.
|
18
17
|
#
|
@@ -72,14 +71,14 @@ class Arguments
|
|
72
71
|
# should not be called directly from application code
|
73
72
|
def initialize(arg, given_index, given_name, resolved_name, argument_spec, given_hyphens, given_label, extras) # :nodoc:
|
74
73
|
|
75
|
-
@arg =
|
76
|
-
@given_index =
|
77
|
-
@given_name =
|
78
|
-
@argument_specification =
|
79
|
-
@given_hyphens =
|
80
|
-
@given_label =
|
81
|
-
@name =
|
82
|
-
@extras =
|
74
|
+
@arg = arg
|
75
|
+
@given_index = given_index
|
76
|
+
@given_name = given_name
|
77
|
+
@argument_specification = argument_spec
|
78
|
+
@given_hyphens = given_hyphens
|
79
|
+
@given_label = given_label
|
80
|
+
@name = resolved_name || given_name
|
81
|
+
@extras = extras.nil? ? {} : extras
|
83
82
|
end
|
84
83
|
|
85
84
|
# (Integer) The command-line index of the argument
|
@@ -160,10 +159,10 @@ class Arguments
|
|
160
159
|
|
161
160
|
if constraint.empty?
|
162
161
|
|
163
|
-
resolved_value =
|
162
|
+
resolved_value = (value || '').empty? ? argument_spec.default_value : value
|
164
163
|
else
|
165
164
|
|
166
|
-
resolved_value =
|
165
|
+
resolved_value = value_from_Hash(constraint, value, arg, given_index, given_name, argument_spec, extras)
|
167
166
|
end
|
168
167
|
else
|
169
168
|
|
@@ -171,19 +170,19 @@ class Arguments
|
|
171
170
|
end
|
172
171
|
else
|
173
172
|
|
174
|
-
resolved_value =
|
173
|
+
resolved_value = value
|
175
174
|
end
|
176
175
|
|
177
|
-
@arg =
|
178
|
-
@given_index =
|
179
|
-
@given_name =
|
180
|
-
@argument_specification =
|
181
|
-
@given_hyphens =
|
182
|
-
@given_label =
|
183
|
-
@given_value =
|
184
|
-
@value =
|
185
|
-
@name =
|
186
|
-
@extras =
|
176
|
+
@arg = arg
|
177
|
+
@given_index = given_index
|
178
|
+
@given_name = given_name
|
179
|
+
@argument_specification = argument_spec
|
180
|
+
@given_hyphens = given_hyphens
|
181
|
+
@given_label = given_label
|
182
|
+
@given_value = value
|
183
|
+
@value = resolved_value
|
184
|
+
@name = resolved_name || given_name
|
185
|
+
@extras = extras.nil? ? {} : extras
|
187
186
|
end
|
188
187
|
|
189
188
|
# (Integer) The command-line index of the argument
|
@@ -300,12 +299,12 @@ class Arguments
|
|
300
299
|
end
|
301
300
|
end
|
302
301
|
|
303
|
-
specs =
|
302
|
+
specs = []
|
304
303
|
|
305
|
-
_clasp =
|
304
|
+
_clasp = h['clasp'] or raise ArgumentError, "missing top-level 'clasp' element in load configuration"
|
306
305
|
::Hash === _clasp or raise ArgumentError, "top-level 'clasp' element must be a #{::Hash}"
|
307
306
|
|
308
|
-
_specs =
|
307
|
+
_specs = (_clasp['arg-specs'] || _clasp['specifications'] || _clasp['aliases']) or raise ArgumentError, "missing element 'clasp/specifications'"
|
309
308
|
::Array === _specs or raise ArgumentError, "top-level 'specifications' element must be a #{::Hash}"
|
310
309
|
|
311
310
|
_specs.each do |_spec|
|
@@ -327,9 +326,9 @@ class Arguments
|
|
327
326
|
warn "flag specification missing required 'name' field"
|
328
327
|
else
|
329
328
|
|
330
|
-
_alias
|
331
|
-
_aliases
|
332
|
-
_help
|
329
|
+
_alias = _details['alias']
|
330
|
+
_aliases = _details['aliases']
|
331
|
+
_help = _details['help'] || _details['description']
|
333
332
|
|
334
333
|
specs << CLASP.Flag(_name, alias: _alias, aliases: _aliases, help: _help)
|
335
334
|
end
|
@@ -342,13 +341,13 @@ class Arguments
|
|
342
341
|
warn "option specification missing required 'name' field"
|
343
342
|
else
|
344
343
|
|
345
|
-
_alias
|
346
|
-
_aliases
|
347
|
-
_default_value
|
348
|
-
_help
|
349
|
-
_required
|
350
|
-
_required_message
|
351
|
-
_values_range
|
344
|
+
_alias = _details['alias']
|
345
|
+
_aliases = _details['aliases']
|
346
|
+
_default_value = _details['default_value'] || _details['default']
|
347
|
+
_help = _details['help'] || _details['description']
|
348
|
+
_required = _details['required']
|
349
|
+
_required_message = _details['required_message']
|
350
|
+
_values_range = _details['values_range'] || _details['values']
|
352
351
|
|
353
352
|
specs << CLASP.Option(_name, alias: _alias, aliases: _aliases, default_value: _default_value, help: _help, required: _required, required_message: _required_message, values_range: _values_range)
|
354
353
|
end
|
@@ -361,8 +360,8 @@ class Arguments
|
|
361
360
|
warn "alias specification missing required 'resolved' field"
|
362
361
|
else
|
363
362
|
|
364
|
-
_alias
|
365
|
-
_aliases
|
363
|
+
_alias = _details['alias']
|
364
|
+
_aliases = _details['aliases']
|
366
365
|
|
367
366
|
unless _alias || _aliases
|
368
367
|
|
@@ -404,20 +403,20 @@ class Arguments
|
|
404
403
|
|
405
404
|
# have to do this name-swap, as 'options' has CLASP-specific
|
406
405
|
# meaning
|
407
|
-
init_opts, options =
|
406
|
+
init_opts, options = options.dup, nil
|
408
407
|
|
409
408
|
init_opts[:mutate_argv] = true unless init_opts.has_key? :mutate_argv
|
410
409
|
|
411
|
-
@program_name =
|
410
|
+
@program_name = init_opts[:program_name] || Arguments.derive_program_name_
|
412
411
|
|
413
|
-
@argv =
|
414
|
-
argv =
|
415
|
-
@argv_original_copy =
|
412
|
+
@argv = argv
|
413
|
+
argv = argv.dup
|
414
|
+
@argv_original_copy = argv.dup.freeze
|
416
415
|
|
417
|
-
@specifications =
|
418
|
-
@aliases =
|
416
|
+
@specifications = specifications
|
417
|
+
@aliases = @specifications
|
419
418
|
|
420
|
-
specifications =
|
419
|
+
specifications = nil if specifications and specifications.empty?
|
421
420
|
|
422
421
|
flags, options, values, double_slash_index = Arguments.parse_(argv, specifications)
|
423
422
|
|
@@ -430,31 +429,31 @@ class Arguments
|
|
430
429
|
|
431
430
|
def to_s
|
432
431
|
|
433
|
-
s
|
432
|
+
s = ''
|
434
433
|
|
435
|
-
s
|
436
|
-
s
|
437
|
-
s
|
434
|
+
s += '['
|
435
|
+
s += self.map { |v| %Q<"#{v}"> }.join(', ')
|
436
|
+
s += ']'
|
438
437
|
|
439
438
|
s
|
440
439
|
end
|
441
440
|
|
442
441
|
def inspect
|
443
442
|
|
444
|
-
s
|
443
|
+
s = ''
|
445
444
|
|
446
|
-
s
|
447
|
-
s
|
448
|
-
s
|
445
|
+
s += "#<#{self.class}:0x#{(object_id << 1).to_s(16)} ["
|
446
|
+
s += self.map { |v| v.inspect }.join(', ')
|
447
|
+
s += "]>"
|
449
448
|
|
450
449
|
s
|
451
450
|
end
|
452
451
|
end
|
453
452
|
end
|
454
453
|
|
455
|
-
@flags
|
456
|
-
@options
|
457
|
-
@values
|
454
|
+
@flags = flags.freeze
|
455
|
+
@options = options.freeze
|
456
|
+
@values = values.freeze
|
458
457
|
|
459
458
|
@double_slash_index = double_slash_index
|
460
459
|
|
@@ -483,14 +482,14 @@ class Arguments
|
|
483
482
|
# @!visibility private
|
484
483
|
def self.parse_(argv, specifications) # :nodoc:
|
485
484
|
|
486
|
-
flags =
|
487
|
-
options =
|
488
|
-
values =
|
485
|
+
flags = []
|
486
|
+
options = []
|
487
|
+
values = []
|
489
488
|
|
490
489
|
double_slash_index = nil
|
491
490
|
|
492
|
-
forced_value =
|
493
|
-
pending_option =
|
491
|
+
forced_value = false
|
492
|
+
pending_option = nil
|
494
493
|
|
495
494
|
argv.each_with_index do |arg, index|
|
496
495
|
|
@@ -509,27 +508,27 @@ class Arguments
|
|
509
508
|
# do regex test to see if option/flag/value
|
510
509
|
if arg =~ /^(-+)([^=]+)/
|
511
510
|
|
512
|
-
hyphens
|
513
|
-
given_label
|
514
|
-
given_name
|
515
|
-
value
|
516
|
-
argument_spec
|
517
|
-
resolved_name
|
511
|
+
hyphens = $1
|
512
|
+
given_label = $2
|
513
|
+
given_name = "#$1#$2"
|
514
|
+
value = ($' and not $'.empty?) ? $'[1 ... $'.size] : nil
|
515
|
+
argument_spec = nil
|
516
|
+
resolved_name = nil
|
518
517
|
|
519
518
|
(specifications || []).each do |s|
|
520
519
|
|
521
520
|
if s.name == given_name or s.aliases.include? given_name
|
522
521
|
|
523
|
-
argument_spec
|
524
|
-
resolved_name
|
522
|
+
argument_spec = s
|
523
|
+
resolved_name = s.name
|
525
524
|
|
526
525
|
# need to check whether the alias is a default-option
|
527
526
|
# and, if so, expand out its name and value, and replace
|
528
527
|
# the name and (if none previously specified) the value
|
529
528
|
if resolved_name =~ /^(-+)([^=]+)=/
|
530
529
|
|
531
|
-
resolved_name
|
532
|
-
value
|
530
|
+
resolved_name = "#$1#$2"
|
531
|
+
value ||= $'
|
533
532
|
|
534
533
|
# now find the underlying (option) specification
|
535
534
|
specifications.each do |t|
|
@@ -554,9 +553,9 @@ class Arguments
|
|
554
553
|
flag_aliases = []
|
555
554
|
given_label[0 ... given_label.size].each_char do |c|
|
556
555
|
|
557
|
-
new_flag =
|
556
|
+
new_flag = "-#{c.chr}"
|
558
557
|
|
559
|
-
flag_alias =
|
558
|
+
flag_alias = nil
|
560
559
|
|
561
560
|
# special case where the flag's actual name is short form and found here
|
562
561
|
flag_alias ||= specifications.detect { |s| s.is_a?(CLASP::FlagSpecification) && s.name == new_flag }
|
@@ -566,11 +565,11 @@ class Arguments
|
|
566
565
|
|
567
566
|
if not flag_alias
|
568
567
|
|
569
|
-
flag_aliases
|
568
|
+
flag_aliases = nil
|
570
569
|
break
|
571
570
|
else
|
572
571
|
|
573
|
-
flag_aliases
|
572
|
+
flag_aliases << flag_alias
|
574
573
|
end
|
575
574
|
end
|
576
575
|
|
@@ -583,7 +582,7 @@ class Arguments
|
|
583
582
|
# convert to argv and invoke
|
584
583
|
flags_argv = flag_aliases.map { |s| s.name }
|
585
584
|
|
586
|
-
grp_flags, grp_options, grp_value,
|
585
|
+
grp_flags, grp_options, grp_value, _grp_double_slash_index = Arguments.parse_(flags_argv, specifications)
|
587
586
|
|
588
587
|
grp_flags.map! { |f| FlagArgument.new(arg, index, given_name, f.name, f.argument_specification, hyphens.size, given_label, argument_spec ? argument_spec.extras : nil) }
|
589
588
|
grp_options.map! { |o| OptionArgument.new(arg, index, given_name, o.name, o.argument_specification, hyphens.size, given_label, o.value, argument_spec ? argument_spec.extras : nil) }
|
@@ -632,8 +631,8 @@ class Arguments
|
|
632
631
|
next unless forced_value
|
633
632
|
end
|
634
633
|
|
635
|
-
arg =
|
636
|
-
arg_ix =
|
634
|
+
arg = arg.dup
|
635
|
+
arg_ix = ::Integer === index ? index : index.dup
|
637
636
|
|
638
637
|
arg.define_singleton_method(:given_index) { arg_ix }
|
639
638
|
|
@@ -761,9 +760,9 @@ class Arguments
|
|
761
760
|
# backwards-compatible
|
762
761
|
|
763
762
|
# @!visibility private
|
764
|
-
Flag =
|
763
|
+
Flag = FlagArgument # :nodoc:
|
765
764
|
# @!visibility private
|
766
|
-
Option =
|
765
|
+
Option = OptionArgument # :nodoc:
|
767
766
|
end # class Arguments
|
768
767
|
|
769
768
|
|
data/lib/clasp/clasp.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: clasp/clasp.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
5
|
+
# Purpose: Common 'require file' for CLASP.Ruby library
|
6
6
|
#
|
7
|
-
# Created:
|
8
|
-
# Updated:
|
7
|
+
# Created: 14th February 2014
|
8
|
+
# Updated: 6th March 2025
|
9
9
|
#
|
10
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/CLASP.Ruby
|
11
11
|
#
|
12
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
-
# Copyright (c)
|
14
|
+
# Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
|
15
|
+
# Copyright (c) 2014-2019, Matthew Wilson and Synesis Software
|
15
16
|
# All rights reserved.
|
16
17
|
#
|
17
18
|
# Redistribution and use in source and binary forms, with or without
|
@@ -50,13 +51,16 @@ require 'clasp/specifications'
|
|
50
51
|
require 'clasp/cli'
|
51
52
|
require 'clasp/version'
|
52
53
|
|
54
|
+
=begin
|
55
|
+
=end
|
56
|
+
|
53
57
|
module CLASP
|
54
58
|
|
55
|
-
|
56
|
-
|
59
|
+
# TBC (but is a shorthand for calling +Arguments.new()+
|
60
|
+
def self.parse(argv = ARGV, specifications = nil, options = {})
|
57
61
|
|
58
|
-
|
59
|
-
|
62
|
+
return Arguments.new(argv, specifications, options)
|
63
|
+
end
|
60
64
|
end # module CLASP
|
61
65
|
|
62
66
|
|