cmdparse 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +13 -0
- data/Rakefile +1 -1
- data/TODO +1 -0
- data/VERSION +1 -1
- data/doc/src/default.template +1 -1
- data/doc/src/index.page +8 -0
- data/doc/src/{documentation.page → tutorial.page} +43 -5
- data/lib/cmdparse.rb +2 -3
- data/lib/cmdparse/wrappers/optparse.rb +1 -1
- metadata +45 -41
data/ChangeLog
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
------------------------------------------------------------------------
|
2
|
+
r398 | thomas | 2006-04-05 16:13:43 +0200 (Wed, 05 Apr 2006) | 1 line
|
3
|
+
Changed paths:
|
4
|
+
A /versions/cmdparse-2.0.1 (from /trunk/cmdparse:340)
|
5
|
+
R /versions/cmdparse-2.0.1/Rakefile (from /trunk/cmdparse/Rakefile:396)
|
6
|
+
R /versions/cmdparse-2.0.1/TODO (from /trunk/cmdparse/TODO:396)
|
7
|
+
R /versions/cmdparse-2.0.1/doc/src/default.template (from /trunk/cmdparse/doc/src/default.template:396)
|
8
|
+
D /versions/cmdparse-2.0.1/doc/src/documentation.page
|
9
|
+
R /versions/cmdparse-2.0.1/doc/src/index.page (from /trunk/cmdparse/doc/src/index.page:396)
|
10
|
+
A /versions/cmdparse-2.0.1/doc/src/tutorial.page (from /trunk/cmdparse/doc/src/tutorial.page:397)
|
11
|
+
R /versions/cmdparse-2.0.1/lib/cmdparse.rb (from /trunk/cmdparse/lib/cmdparse.rb:396)
|
12
|
+
|
13
|
+
* created version 2.0.1 of cmdparse
|
14
|
+
------------------------------------------------------------------------
|
2
15
|
r332 | thomas | 2005-08-16 10:54:01 +0200 (Tue, 16 Aug 2005) | 1 line
|
3
16
|
Changed paths:
|
4
17
|
M /trunk/cmdparse/doc/src/index.page
|
data/Rakefile
CHANGED
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
data/doc/src/default.template
CHANGED
data/doc/src/index.page
CHANGED
@@ -12,6 +12,14 @@ Have a look around the site!
|
|
12
12
|
|
13
13
|
h2. News
|
14
14
|
|
15
|
+
<b>2006-04-05 cmdparse 2.0.1 released!!!</b>
|
16
|
+
|
17
|
+
Changes:
|
18
|
+
|
19
|
+
* Just a bug fix release for those using cmdparse with Rubygems. By issuing the command
|
20
|
+
@require_gem 'cmdparse'@ the cmdparse library gets automagically loaded.
|
21
|
+
* Minor documentation updates
|
22
|
+
|
15
23
|
<b>2005-08-16 cmdparse 2.0.0 released!!!</b>
|
16
24
|
|
17
25
|
This version is not compatible to previous versions of cmdparse as there have been major changes in
|
@@ -1,14 +1,52 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Tutorial
|
3
3
|
inMenu: true
|
4
4
|
orderInfo: 6
|
5
5
|
---
|
6
|
-
h2.
|
6
|
+
h2. Quickstart
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
Here are some short code fragments which show how to use cmdparse. A complete example app can be
|
9
|
+
found later in the "tutorial section":#tutorial.
|
10
10
|
|
11
|
-
|
11
|
+
Defining commands using classes:
|
12
|
+
<pre>
|
13
|
+
class TestCmd < CmdParse::Command
|
14
|
+
def initialize
|
15
|
+
super('test', true)
|
16
|
+
self.add_command(TestSubCmd.new)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class TestSubCmd < CmdParse::Command
|
21
|
+
def initialize
|
22
|
+
super('sub',false)
|
23
|
+
end
|
24
|
+
|
25
|
+
def execute (args)
|
26
|
+
puts "Hallo #{args}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
cmd = CmdParse::CommandParser.new( true )
|
31
|
+
cmd.add_command(TestCmd.new)
|
32
|
+
</pre>
|
33
|
+
|
34
|
+
Defining command using the basic @CmdParse::Command@ class:
|
35
|
+
<pre>
|
36
|
+
cmd = CmdParse::CommandParser.new( true )
|
37
|
+
testcmd = CmdParse::Command.new( 'test', true )
|
38
|
+
testcmd.short_desc = "Short desc"
|
39
|
+
cmd.add_command( testcmd )
|
40
|
+
|
41
|
+
sub = CmdParse::Command.new( 'sub', false )
|
42
|
+
sub.short_desc = "Add an IP address"
|
43
|
+
sub.set_execution_block do |args|
|
44
|
+
puts "Hallo #{args}"
|
45
|
+
end
|
46
|
+
testcmd.add_command( sub )
|
47
|
+
</pre>
|
48
|
+
|
49
|
+
h2(#tutorial). Tutorial
|
12
50
|
|
13
51
|
<b>The complete code for this example can be found in the file @net.rb@ of the @cmdparse@
|
14
52
|
package!</b>
|
data/lib/cmdparse.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: cmdparse.rb
|
4
|
+
# $Id: cmdparse.rb 398 2006-04-05 14:13:43Z thomas $
|
5
5
|
#
|
6
6
|
# cmdparse: advanced command line parser supporting commands
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -25,7 +25,7 @@
|
|
25
25
|
module CmdParse
|
26
26
|
|
27
27
|
# The version of this cmdparse implemention
|
28
|
-
VERSION = [2, 0,
|
28
|
+
VERSION = [2, 0, 1]
|
29
29
|
|
30
30
|
|
31
31
|
# Base class for all cmdparse errors.
|
@@ -240,7 +240,6 @@ module CmdParse
|
|
240
240
|
|
241
241
|
end
|
242
242
|
|
243
|
-
|
244
243
|
# The default help command. It adds the options "-h" and "--help" to the global options of the
|
245
244
|
# associated +CommandParser+. When the command is specified on the command line, it can show the
|
246
245
|
# main help or individual command help.
|
metadata
CHANGED
@@ -1,65 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.11
|
3
3
|
specification_version: 1
|
4
4
|
name: cmdparse
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 2.0.
|
7
|
-
date:
|
6
|
+
version: 2.0.1
|
7
|
+
date: 2006-04-05 00:00:00 +02:00
|
8
8
|
summary: Advanced command line parser supporting commands
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: t_leitner@gmx.at
|
12
12
|
homepage: http://cmdparse.rubyforge.org
|
13
13
|
rubyforge_project: cmdparse
|
14
|
-
description:
|
15
|
-
|
16
|
-
Programs that use such command line interfaces are, for example, subversion's
|
17
|
-
'svn' or Rubygem's 'gem' program."
|
18
|
-
autorequire:
|
14
|
+
description: cmdparse provides classes for parsing commands on the command line; command line options are parsed using optparse or any other option parser implementation. Programs that use such command line interfaces are, for example, subversion's 'svn' or Rubygem's 'gem' program.
|
15
|
+
autorequire: cmdparse
|
19
16
|
default_executable:
|
20
17
|
bindir: bin
|
21
18
|
has_rdoc: true
|
22
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
23
20
|
requirements:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
28
24
|
version:
|
29
25
|
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
30
28
|
authors:
|
31
|
-
|
29
|
+
- Thomas Leitner
|
32
30
|
files:
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
31
|
+
- setup.rb
|
32
|
+
- TODO
|
33
|
+
- COPYING
|
34
|
+
- README
|
35
|
+
- Rakefile
|
36
|
+
- ChangeLog
|
37
|
+
- net.rb
|
38
|
+
- VERSION
|
39
|
+
- lib/cmdparse.rb
|
40
|
+
- lib/cmdparse/wrappers/optparse.rb
|
41
|
+
- doc/src
|
42
|
+
- doc/config.yaml
|
43
|
+
- doc/plugin
|
44
|
+
- doc/src/default.css
|
45
|
+
- doc/src/features.page
|
46
|
+
- doc/src/index.page
|
47
|
+
- doc/src/about.page
|
48
|
+
- doc/src/download.page
|
49
|
+
- doc/src/default.template
|
50
|
+
- doc/src/tutorial.page
|
51
|
+
- doc/src/meta.info
|
52
|
+
- doc/src/logo.png
|
53
|
+
- doc/plugin/extract.rb
|
56
54
|
test_files: []
|
55
|
+
|
57
56
|
rdoc_options:
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
- --line-numbers
|
58
|
+
- -m
|
59
|
+
- CmdParse::CommandParser
|
61
60
|
extra_rdoc_files: []
|
61
|
+
|
62
62
|
executables: []
|
63
|
+
|
63
64
|
extensions: []
|
65
|
+
|
64
66
|
requirements: []
|
65
|
-
|
67
|
+
|
68
|
+
dependencies: []
|
69
|
+
|