cmdparse 2.0.3 → 2.0.4
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.
- data/README +1 -1
- data/Rakefile +1 -2
- data/VERSION +1 -1
- data/lib/cmdparse.rb +142 -114
- data/lib/cmdparse/wrappers/optparse.rb +12 -12
- metadata +24 -40
- data/ChangeLog +0 -0
data/README
CHANGED
data/Rakefile
CHANGED
@@ -99,7 +99,6 @@ PKG_FILES = FileList.new( [
|
|
99
99
|
'COPYING.LESSER',
|
100
100
|
'README',
|
101
101
|
'Rakefile',
|
102
|
-
'ChangeLog',
|
103
102
|
'net.rb',
|
104
103
|
'VERSION',
|
105
104
|
'lib/**/*.rb',
|
@@ -151,7 +150,7 @@ else
|
|
151
150
|
File.open('VERSION', 'w+') do |file| file.write( PKG_VERSION + "\n" ) end
|
152
151
|
end
|
153
152
|
|
154
|
-
CLOBBER << "
|
153
|
+
CLOBBER << "VERSION"
|
155
154
|
|
156
155
|
Rake::GemPackageTask.new( spec ) do |pkg|
|
157
156
|
pkg.need_zip = true
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.4
|
data/lib/cmdparse.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
# cmdparse: advanced command line parser supporting commands
|
4
|
-
# Copyright (C) 2004-
|
4
|
+
# Copyright (C) 2004-2012 Thomas Leitner
|
5
5
|
#
|
6
6
|
# This file is part of cmdparse.
|
7
7
|
#
|
@@ -23,18 +23,18 @@
|
|
23
23
|
module CmdParse
|
24
24
|
|
25
25
|
# The version of this cmdparse implemention
|
26
|
-
VERSION = [2, 0,
|
26
|
+
VERSION = [2, 0, 4]
|
27
27
|
|
28
28
|
|
29
29
|
# Base class for all cmdparse errors.
|
30
30
|
class ParseError < RuntimeError
|
31
31
|
|
32
|
-
#
|
33
|
-
def self.reason(
|
32
|
+
# Set the reason for a subclass.
|
33
|
+
def self.reason(reason, has_arguments = true)
|
34
34
|
(@@reason ||= {})[self] = [reason, has_arguments]
|
35
35
|
end
|
36
36
|
|
37
|
-
#
|
37
|
+
# Return the reason plus the message.
|
38
38
|
def message
|
39
39
|
data = @@reason[self.class] || ['Unknown error', true]
|
40
40
|
data[0] + (data[1] ? ": " + super : '')
|
@@ -71,27 +71,27 @@ module CmdParse
|
|
71
71
|
# Base class for all parser wrappers.
|
72
72
|
class ParserWrapper
|
73
73
|
|
74
|
-
#
|
74
|
+
# Return the parser instance for the object and, if a block is a given, yield the instance.
|
75
75
|
def instance
|
76
76
|
yield @instance if block_given?
|
77
77
|
@instance
|
78
78
|
end
|
79
79
|
|
80
|
-
#
|
80
|
+
# Parse the arguments in order, i.e. stops at the first non-option argument, and returns all
|
81
81
|
# remaining arguments.
|
82
|
-
def order(
|
83
|
-
raise InvalidOptionError.new(
|
82
|
+
def order(args)
|
83
|
+
raise InvalidOptionError.new(args[0]) if args[0] =~ /^-/
|
84
84
|
args
|
85
85
|
end
|
86
86
|
|
87
|
-
#
|
87
|
+
# Permute the arguments so that all options anywhere on the command line are parsed and the
|
88
88
|
# remaining non-options are returned.
|
89
|
-
def permute(
|
90
|
-
raise InvalidOptionError.new(
|
89
|
+
def permute(args)
|
90
|
+
raise InvalidOptionError.new(args[0]) if args.any? {|a| a =~ /^-/}
|
91
91
|
args
|
92
92
|
end
|
93
93
|
|
94
|
-
#
|
94
|
+
# Return a summary string of the options.
|
95
95
|
def summarize
|
96
96
|
""
|
97
97
|
end
|
@@ -105,10 +105,10 @@ module CmdParse
|
|
105
105
|
# non-ambigous matching key
|
106
106
|
class CommandHash < Hash
|
107
107
|
|
108
|
-
def [](
|
108
|
+
def [](cmd_name)
|
109
109
|
super or begin
|
110
|
-
possible = keys.select {|key| key
|
111
|
-
fetch(
|
110
|
+
possible = keys.select {|key| key[0, cmd_name.length] == cmd_name }
|
111
|
+
fetch(possible[0]) if possible.size == 1
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
@@ -121,10 +121,11 @@ module CmdParse
|
|
121
121
|
# The name of the command
|
122
122
|
attr_reader :name
|
123
123
|
|
124
|
-
# A short description of the command.
|
124
|
+
# A short description of the command. Should ideally be smaller than 60 characters.
|
125
125
|
attr_accessor :short_desc
|
126
126
|
|
127
|
-
# A detailed description of the command
|
127
|
+
# A detailed description of the command. Maybe a single string or an array of strings for
|
128
|
+
# multiline description. Each string should ideally be smaller than 76 characters.
|
128
129
|
attr_accessor :description
|
129
130
|
|
130
131
|
# The wrapper for parsing the command line options.
|
@@ -140,34 +141,49 @@ module CmdParse
|
|
140
141
|
# Returns the list of commands for this command.
|
141
142
|
attr_reader :commands
|
142
143
|
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
|
144
|
+
# Initialize the command called +name+.
|
145
|
+
#
|
146
|
+
# Parameters:
|
147
|
+
#
|
148
|
+
# [has_commands]
|
149
|
+
# Specifies if this command takes other commands as argument.
|
150
|
+
# [partial_commands (optional)]
|
151
|
+
# Specifies whether partial command matching should be used.
|
152
|
+
# [has_args (optional)]
|
153
|
+
# Specifies whether this command takes arguments
|
154
|
+
def initialize(name, has_commands, partial_commands = false, has_args = true)
|
147
155
|
@name = name
|
148
156
|
@options = ParserWrapper.new
|
149
157
|
@has_commands = has_commands
|
158
|
+
@has_args = has_args
|
150
159
|
@commands = Hash.new
|
151
160
|
@default_command = nil
|
152
|
-
use_partial_commands(
|
161
|
+
use_partial_commands(partial_commands)
|
153
162
|
end
|
154
163
|
|
155
|
-
|
156
|
-
|
157
|
-
temp
|
164
|
+
# Define whether partial command matching should be used.
|
165
|
+
def use_partial_commands(use_partial)
|
166
|
+
temp = (use_partial ? CommandHash.new : Hash.new)
|
167
|
+
temp.update(@commands)
|
158
168
|
@commands = temp
|
159
169
|
end
|
160
170
|
|
161
|
-
#
|
171
|
+
# Return +true+ if this command supports sub commands.
|
162
172
|
def has_commands?
|
163
173
|
@has_commands
|
164
174
|
end
|
165
175
|
|
166
|
-
#
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
176
|
+
# Return +true+ if this command uses arguments.
|
177
|
+
def has_args?
|
178
|
+
@has_args
|
179
|
+
end
|
180
|
+
|
181
|
+
# Add a command to the command list if this command takes other commands as argument.
|
182
|
+
#
|
183
|
+
# If the optional parameter +default+ is true, then this command is used when no command is
|
184
|
+
# specified on the command line.
|
185
|
+
def add_command(command, default = false)
|
186
|
+
raise TakesNoCommandError.new(@name) if !has_commands?
|
171
187
|
@commands[command.name] = command
|
172
188
|
@default_command = command.name if default
|
173
189
|
command.super_command = self
|
@@ -175,24 +191,24 @@ module CmdParse
|
|
175
191
|
end
|
176
192
|
|
177
193
|
# For sorting commands by name.
|
178
|
-
def <=>(
|
194
|
+
def <=>(other)
|
179
195
|
@name <=> other.name
|
180
196
|
end
|
181
197
|
|
182
|
-
#
|
183
|
-
#
|
198
|
+
# Return the +CommandParser+ instance for this command or +nil+ if this command was not assigned
|
199
|
+
# to a +CommandParser+ instance.
|
184
200
|
def commandparser
|
185
201
|
cmd = super_command
|
186
|
-
cmd = cmd.super_command while !cmd.nil? && !cmd.kind_of?(
|
202
|
+
cmd = cmd.super_command while !cmd.nil? && !cmd.kind_of?(CommandParser)
|
187
203
|
cmd
|
188
204
|
end
|
189
205
|
|
190
|
-
#
|
206
|
+
# Return a list of super commands, ie.:
|
191
207
|
# [command, super_command, super_super_command, ...]
|
192
208
|
def super_commands
|
193
209
|
cmds = []
|
194
210
|
cmd = self
|
195
|
-
while !cmd.nil? && !cmd.super_command.kind_of?(
|
211
|
+
while !cmd.nil? && !cmd.super_command.kind_of?(CommandParser)
|
196
212
|
cmds << cmd
|
197
213
|
cmd = cmd.super_command
|
198
214
|
end
|
@@ -203,40 +219,55 @@ module CmdParse
|
|
203
219
|
def init; end
|
204
220
|
|
205
221
|
# Set the given +block+ as execution block. See also: +execute+.
|
206
|
-
def set_execution_block(
|
222
|
+
def set_execution_block(&block)
|
207
223
|
@exec_block = block
|
208
224
|
end
|
209
225
|
|
210
|
-
#
|
211
|
-
#
|
212
|
-
|
213
|
-
|
226
|
+
# Invoke the block set by +set_execution_block+.
|
227
|
+
#
|
228
|
+
# This method is called by the +CommandParser+ instance if this command was specified on the
|
229
|
+
# command line.
|
230
|
+
def execute(args)
|
231
|
+
@exec_block.call(args)
|
214
232
|
end
|
215
233
|
|
216
|
-
#
|
234
|
+
# Define the usage line for the command.
|
217
235
|
def usage
|
218
236
|
tmp = "Usage: #{commandparser.program_name}"
|
219
|
-
tmp << " [options]
|
237
|
+
tmp << " [global options]" if !commandparser.options.instance_of?(ParserWrapper)
|
220
238
|
tmp << super_commands.reverse.collect do |c|
|
221
|
-
t = c.name
|
222
|
-
t << " [options]" if !c.options.instance_of?(
|
239
|
+
t = " #{c.name}"
|
240
|
+
t << " [options]" if !c.options.instance_of?(ParserWrapper)
|
223
241
|
t
|
224
|
-
end.join('
|
225
|
-
tmp <<
|
242
|
+
end.join('')
|
243
|
+
tmp << " COMMAND [options]" if has_commands?
|
244
|
+
tmp << " [ARGS]" if has_args?
|
245
|
+
tmp
|
226
246
|
end
|
227
247
|
|
228
248
|
# Default method for showing the help for the command.
|
229
249
|
def show_help
|
230
|
-
puts "
|
231
|
-
puts description if description
|
232
|
-
puts
|
250
|
+
puts commandparser.banner + "\n" if commandparser.banner
|
233
251
|
puts usage
|
234
252
|
puts
|
253
|
+
if short_desc && !short_desc.empty?
|
254
|
+
puts short_desc
|
255
|
+
puts
|
256
|
+
end
|
257
|
+
if description && !description.empty?
|
258
|
+
puts " " + [description].flatten.join("\n ")
|
259
|
+
puts
|
260
|
+
end
|
235
261
|
if has_commands?
|
236
262
|
list_commands
|
237
263
|
puts
|
238
264
|
end
|
239
|
-
|
265
|
+
if !(summary = options.summarize).empty?
|
266
|
+
puts summary
|
267
|
+
puts
|
268
|
+
end
|
269
|
+
if self != commandparser.main_command &&
|
270
|
+
!(summary = commandparser.main_command.options.summarize).empty?
|
240
271
|
puts summary
|
241
272
|
puts
|
242
273
|
end
|
@@ -246,14 +277,18 @@ module CmdParse
|
|
246
277
|
private
|
247
278
|
#######
|
248
279
|
|
249
|
-
def list_commands(
|
250
|
-
puts "Available commands:"
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
280
|
+
def list_commands(command = self)
|
281
|
+
puts "Available commands:"
|
282
|
+
puts " " + collect_commands_info(command).join("\n ")
|
283
|
+
end
|
284
|
+
|
285
|
+
def collect_commands_info(command, level = 1)
|
286
|
+
command.commands.sort.collect do |name, cmd|
|
287
|
+
str = " "*level + name
|
288
|
+
str = str.ljust(18) + cmd.short_desc.to_s
|
289
|
+
str += " (default command)" if name == command.default_command
|
290
|
+
[str] + (cmd.has_commands? ? collect_commands_info(cmd, level + 1) : [])
|
291
|
+
end.flatten
|
257
292
|
end
|
258
293
|
|
259
294
|
end
|
@@ -264,19 +299,19 @@ module CmdParse
|
|
264
299
|
class HelpCommand < Command
|
265
300
|
|
266
301
|
def initialize
|
267
|
-
super(
|
302
|
+
super('help', false)
|
268
303
|
self.short_desc = 'Provide help for individual commands'
|
269
|
-
self.description = 'This command prints the program help if no arguments are given. '
|
270
|
-
|
271
|
-
|
304
|
+
self.description = ['This command prints the program help if no arguments are given. If one or',
|
305
|
+
'more command names are given as arguments, these arguments are interpreted',
|
306
|
+
'as a hierachy of commands and the help for the right most command is show.']
|
272
307
|
end
|
273
308
|
|
274
309
|
def init
|
275
310
|
case commandparser.main_command.options
|
276
311
|
when OptionParserWrapper
|
277
312
|
commandparser.main_command.options.instance do |opt|
|
278
|
-
opt.on_tail(
|
279
|
-
execute(
|
313
|
+
opt.on_tail("-h", "--help", "Show help") do
|
314
|
+
execute([])
|
280
315
|
end
|
281
316
|
end
|
282
317
|
end
|
@@ -286,39 +321,25 @@ module CmdParse
|
|
286
321
|
"Usage: #{commandparser.program_name} help [COMMAND SUBCOMMAND ...]"
|
287
322
|
end
|
288
323
|
|
289
|
-
def execute(
|
324
|
+
def execute(args)
|
290
325
|
if args.length > 0
|
291
326
|
cmd = commandparser.main_command
|
292
327
|
arg = args.shift
|
293
|
-
while !arg.nil? && cmd.commands[
|
328
|
+
while !arg.nil? && cmd.commands[arg]
|
294
329
|
cmd = cmd.commands[arg]
|
295
330
|
arg = args.shift
|
296
331
|
end
|
297
332
|
if arg.nil?
|
298
333
|
cmd.show_help
|
299
334
|
else
|
300
|
-
raise InvalidArgumentError, args.unshift(
|
335
|
+
raise InvalidArgumentError, args.unshift(arg).join(' ')
|
301
336
|
end
|
302
337
|
else
|
303
|
-
|
338
|
+
commandparser.main_command.show_help
|
304
339
|
end
|
305
340
|
exit
|
306
341
|
end
|
307
342
|
|
308
|
-
#######
|
309
|
-
private
|
310
|
-
#######
|
311
|
-
|
312
|
-
def show_program_help
|
313
|
-
puts commandparser.banner + "\n" if commandparser.banner
|
314
|
-
puts "Usage: #{commandparser.program_name} [options] COMMAND [options] [COMMAND [options] ...] [args]"
|
315
|
-
puts ""
|
316
|
-
list_commands( 1, commandparser.main_command )
|
317
|
-
puts ""
|
318
|
-
puts commandparser.main_command.options.summarize
|
319
|
-
puts
|
320
|
-
end
|
321
|
-
|
322
343
|
end
|
323
344
|
|
324
345
|
|
@@ -328,7 +349,7 @@ module CmdParse
|
|
328
349
|
class VersionCommand < Command
|
329
350
|
|
330
351
|
def initialize
|
331
|
-
super(
|
352
|
+
super('version', false, false, false)
|
332
353
|
self.short_desc = "Show the version of the program"
|
333
354
|
end
|
334
355
|
|
@@ -336,8 +357,8 @@ module CmdParse
|
|
336
357
|
case commandparser.main_command.options
|
337
358
|
when OptionParserWrapper
|
338
359
|
commandparser.main_command.options.instance do |opt|
|
339
|
-
opt.on_tail(
|
340
|
-
execute(
|
360
|
+
opt.on_tail("--version", "-v", "Show the version of the program") do
|
361
|
+
execute([])
|
341
362
|
end
|
342
363
|
end
|
343
364
|
end
|
@@ -347,11 +368,11 @@ module CmdParse
|
|
347
368
|
"Usage: #{commandparser.program_name} version"
|
348
369
|
end
|
349
370
|
|
350
|
-
def execute(
|
371
|
+
def execute(args)
|
351
372
|
version = commandparser.program_version
|
352
|
-
version = version.join(
|
373
|
+
version = version.join('.') if version.instance_of?(Array)
|
353
374
|
puts commandparser.banner + "\n" if commandparser.banner
|
354
|
-
puts version
|
375
|
+
puts "#{commandparser.program_name} #{version}"
|
355
376
|
exit
|
356
377
|
end
|
357
378
|
|
@@ -373,49 +394,56 @@ module CmdParse
|
|
373
394
|
# The version of the program.
|
374
395
|
attr_accessor :program_version
|
375
396
|
|
376
|
-
#
|
397
|
+
# Should exceptions be handled gracefully? I.e. by printing error message and the help screen?
|
377
398
|
attr_reader :handle_exceptions
|
378
399
|
|
379
|
-
# Create a new CommandParser object.
|
380
|
-
#
|
381
|
-
#
|
382
|
-
|
383
|
-
|
400
|
+
# Create a new CommandParser object.
|
401
|
+
#
|
402
|
+
# [handleExceptions (optional)]
|
403
|
+
# Specifies if the object should handle exceptions gracefully.
|
404
|
+
# [partial_commands (optional)]
|
405
|
+
# Specifies if you want partial command matching for the top level commands.
|
406
|
+
# [has_args (optional)]
|
407
|
+
# Specifies whether the command parser takes arguments (only used when no sub commands are
|
408
|
+
# defined).
|
409
|
+
def initialize(handleExceptions = false, partial_commands = false, has_args = true)
|
410
|
+
@main_command = Command.new('mainCommand', true, partial_commands, has_args)
|
384
411
|
@main_command.super_command = self
|
385
|
-
@main_command.use_partial_commands( partial_commands )
|
386
412
|
@program_name = $0
|
387
413
|
@program_version = "0.0.0"
|
388
414
|
@handle_exceptions = handleExceptions
|
389
415
|
end
|
390
416
|
|
391
|
-
#
|
417
|
+
# Return the wrapper for parsing the global options.
|
392
418
|
def options
|
393
419
|
@main_command.options
|
394
420
|
end
|
395
421
|
|
396
|
-
#
|
397
|
-
def options=(
|
422
|
+
# Set the wrapper for parsing the global options.
|
423
|
+
def options=(wrapper)
|
398
424
|
@main_command.options = wrapper
|
399
425
|
end
|
400
426
|
|
401
|
-
#
|
402
|
-
def add_command(
|
403
|
-
@main_command.add_command(
|
427
|
+
# Add a top level command.
|
428
|
+
def add_command(*args)
|
429
|
+
@main_command.add_command(*args)
|
404
430
|
end
|
405
431
|
|
406
|
-
#
|
407
|
-
#
|
408
|
-
|
432
|
+
# Parse the command line arguments.
|
433
|
+
#
|
434
|
+
# If a block is specified, the current hierarchy level and the name of the current command is
|
435
|
+
# yielded before any option parsing is done.
|
436
|
+
def parse(argv = ARGV) # :yields: level, commandName
|
409
437
|
level = 0
|
410
438
|
command = @main_command
|
411
439
|
|
412
440
|
while !command.nil?
|
413
|
-
|
414
|
-
|
441
|
+
yield(level, command.name) if block_given?
|
442
|
+
argv = if command.has_commands? || ENV.include?('POSIXLY_CORRECT')
|
443
|
+
command.options.order(argv)
|
415
444
|
else
|
416
|
-
command.options.permute(
|
445
|
+
command.options.permute(argv)
|
417
446
|
end
|
418
|
-
yield( level, command.name ) if block_given?
|
419
447
|
|
420
448
|
if command.has_commands?
|
421
449
|
cmdName, argv = argv[0], argv[1..-1] || []
|
@@ -427,13 +455,13 @@ module CmdParse
|
|
427
455
|
cmdName = command.default_command
|
428
456
|
end
|
429
457
|
else
|
430
|
-
raise InvalidCommandError.new(
|
458
|
+
raise InvalidCommandError.new(cmdName) unless command.commands[ cmdName ]
|
431
459
|
end
|
432
460
|
|
433
461
|
command = command.commands[cmdName]
|
434
462
|
level += 1
|
435
463
|
else
|
436
|
-
command.execute(
|
464
|
+
command.execute(argv)
|
437
465
|
command = nil
|
438
466
|
end
|
439
467
|
end
|
@@ -441,7 +469,7 @@ module CmdParse
|
|
441
469
|
raise if !@handle_exceptions
|
442
470
|
puts "Error while parsing command line:\n " + e.message
|
443
471
|
puts
|
444
|
-
@main_command.commands['help'].execute(
|
472
|
+
@main_command.commands['help'].execute(command.super_commands.reverse.collect {|c| c.name}) if @main_command.commands['help']
|
445
473
|
exit
|
446
474
|
end
|
447
475
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
# cmdparse: advanced command line parser supporting commands
|
4
|
-
# Copyright (C) 2004-
|
4
|
+
# Copyright (C) 2004-2012 Thomas Leitner
|
5
5
|
#
|
6
6
|
# This file is part of cmdparse.
|
7
7
|
#
|
@@ -24,12 +24,12 @@ require 'optparse'
|
|
24
24
|
# Some extension to the standard option parser class
|
25
25
|
class OptionParser
|
26
26
|
|
27
|
-
if const_defined?(
|
28
|
-
Officious.delete(
|
29
|
-
Officious.delete(
|
27
|
+
if const_defined?('Officious')
|
28
|
+
Officious.delete('version')
|
29
|
+
Officious.delete('help')
|
30
30
|
else
|
31
|
-
DefaultList.long.delete(
|
32
|
-
DefaultList.long.delete(
|
31
|
+
DefaultList.long.delete('version')
|
32
|
+
DefaultList.long.delete('help')
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -41,17 +41,17 @@ module CmdParse
|
|
41
41
|
|
42
42
|
# Initializes the wrapper with a default OptionParser instance or the +parser+ parameter and
|
43
43
|
# yields this instance.
|
44
|
-
def initialize(
|
44
|
+
def initialize(parser = OptionParser.new, &block)
|
45
45
|
@instance = parser
|
46
|
-
self.instance(
|
46
|
+
self.instance(&block)
|
47
47
|
end
|
48
48
|
|
49
|
-
def order(
|
50
|
-
@instance.order(
|
49
|
+
def order(args)
|
50
|
+
@instance.order(args)
|
51
51
|
end
|
52
52
|
|
53
|
-
def permute(
|
54
|
-
@instance.permute(
|
53
|
+
def permute(args)
|
54
|
+
@instance.permute(args)
|
55
55
|
end
|
56
56
|
|
57
57
|
def summarize
|
metadata
CHANGED
@@ -1,39 +1,31 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmdparse
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 2
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
version: 2.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Thomas Leitner
|
13
9
|
autorequire: cmdparse
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2011-01-05 00:00:00 +01:00
|
18
|
-
default_executable:
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
|
-
|
14
|
+
description: ! " cmdparse provides classes for parsing commands on the command
|
15
|
+
line; command line options\n are parsed using optparse or any other option
|
16
|
+
parser implementation. Programs that use\n such command line interfaces are,
|
17
|
+
for example, subversion's 'svn' or Rubygem's 'gem' program.\n"
|
22
18
|
email: t_leitner@gmx.at
|
23
19
|
executables: []
|
24
|
-
|
25
20
|
extensions: []
|
26
|
-
|
27
21
|
extra_rdoc_files: []
|
28
|
-
|
29
|
-
files:
|
22
|
+
files:
|
30
23
|
- setup.rb
|
31
24
|
- TODO
|
32
25
|
- COPYING
|
33
26
|
- COPYING.LESSER
|
34
27
|
- README
|
35
28
|
- Rakefile
|
36
|
-
- ChangeLog
|
37
29
|
- net.rb
|
38
30
|
- VERSION
|
39
31
|
- lib/cmdparse/wrappers/optparse.rb
|
@@ -49,39 +41,31 @@ files:
|
|
49
41
|
- doc/src/download.page
|
50
42
|
- doc/src/default.template
|
51
43
|
- doc/src/about.page
|
52
|
-
has_rdoc: true
|
53
44
|
homepage: http://cmdparse.rubyforge.org
|
54
45
|
licenses: []
|
55
|
-
|
56
46
|
post_install_message:
|
57
|
-
rdoc_options:
|
47
|
+
rdoc_options:
|
58
48
|
- --line-numbers
|
59
49
|
- -m
|
60
50
|
- CmdParse::CommandParser
|
61
|
-
require_paths:
|
51
|
+
require_paths:
|
62
52
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
54
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
|
70
|
-
version: "0"
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
60
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
79
65
|
requirements: []
|
80
|
-
|
81
66
|
rubyforge_project: cmdparse
|
82
|
-
rubygems_version: 1.
|
67
|
+
rubygems_version: 1.8.24
|
83
68
|
signing_key:
|
84
69
|
specification_version: 3
|
85
70
|
summary: Advanced command line parser supporting commands
|
86
71
|
test_files: []
|
87
|
-
|
data/ChangeLog
DELETED
File without changes
|