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 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
@@ -124,7 +124,7 @@ else
124
124
  s.files = PKG_FILES.to_a
125
125
 
126
126
  s.require_path = 'lib'
127
- s.autorequire = nil
127
+ s.autorequire = 'cmdparse'
128
128
 
129
129
  #### Documentation
130
130
 
data/TODO CHANGED
@@ -1,3 +1,4 @@
1
+ * see mail from Markus Werner concerning class methods for defining methods as sub commands
1
2
 
2
3
  ---- DONE ----
3
4
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -20,7 +20,7 @@
20
20
  </div>
21
21
 
22
22
  <div id="headerbar" class="bar">
23
- <span class="left">Navbar: {navbar: }</span>
23
+ <span class="left">Navbar: {breadcrumbTrail: }</span>
24
24
  <span class="right">Language: {langbar: }</span>
25
25
  <div style="clear:both"></div>
26
26
  </div>
@@ -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: Documentation
2
+ title: Tutorial
3
3
  inMenu: true
4
4
  orderInfo: 6
5
5
  ---
6
- h2. Documentation
6
+ h2. Quickstart
7
7
 
8
- The <a href="{relocatable: /rdoc/index.html}">API reference</a> provides information on how to use
9
- @cmdparse@. Here is only a short tutorial which shows most of the features.
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
- h2. Tutorial
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>
@@ -1,7 +1,7 @@
1
1
  #
2
2
  #--
3
3
  #
4
- # $Id: cmdparse.rb 329 2005-08-14 15:39:05Z thomas $
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, 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.
@@ -1,7 +1,7 @@
1
1
  #
2
2
  #--
3
3
  #
4
- # $Id: optparse.rb 329 2005-08-14 15:39:05Z thomas $
4
+ # $Id: optparse.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
metadata CHANGED
@@ -1,65 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.6
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.0
7
- date: 2005-08-16
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
- - lib
10
+ - lib
11
11
  email: t_leitner@gmx.at
12
12
  homepage: http://cmdparse.rubyforge.org
13
13
  rubyforge_project: cmdparse
14
- description: "cmdparse provides classes for parsing commands on the command line; command line
15
- options are parsed using optparse or any other option parser implementation.
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
- - !ruby/object:Gem::Version
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
- - Thomas Leitner
29
+ - Thomas Leitner
32
30
  files:
33
- - setup.rb
34
- - TODO
35
- - COPYING
36
- - README
37
- - Rakefile
38
- - ChangeLog
39
- - net.rb
40
- - VERSION
41
- - lib/cmdparse.rb
42
- - lib/cmdparse/wrappers/optparse.rb
43
- - doc/src
44
- - doc/config.yaml
45
- - doc/plugin
46
- - doc/src/default.css
47
- - doc/src/features.page
48
- - doc/src/index.page
49
- - doc/src/about.page
50
- - doc/src/download.page
51
- - doc/src/default.template
52
- - doc/src/meta.info
53
- - doc/src/logo.png
54
- - doc/src/documentation.page
55
- - doc/plugin/extract.rb
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
- - "--line-numbers"
59
- - "-m"
60
- - CmdParse::CommandParser
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
- dependencies: []
67
+
68
+ dependencies: []
69
+