~ubuntu-branches/ubuntu/wily/ctioga2/wily

« back to all changes in this revision

Viewing changes to lib/ctioga2/commands/arguments.rb

  • Committer: Package Import Robot
  • Author(s): Vincent Fourmond
  • Date: 2013-07-08 20:58:17 UTC
  • mfrom: (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130708205817-cephnc6etndyxrrp
Tags: 0.4-2
* Upload to unstable
* Already conforms to newer standards

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
module CTioga2
18
18
 
19
 
  Version::register_svn_info('$Revision: 18 $', '$Date: 2009-04-28 23:43:54 +0200 (Tue, 28 Apr 2009) $')
 
19
  Version::register_svn_info('$Revision: 355 $', '$Date: 2012-12-26 00:19:04 +0100 (Wed, 26 Dec 2012) $')
20
20
 
21
21
  module Commands
22
22
 
23
23
    # An argument to a Command
 
24
    #
 
25
    # @todo There should be real options mangling capacities, with:
 
26
    # * (possibly deprecated) aliases for options
 
27
    # * _ to - mangling
 
28
    # * other things ?
24
29
    class CommandArgument
25
30
 
26
 
      # The type of the argument, a CTioga2::MetaBuilder::Type object.
 
31
      # The type of the argument, a CommandType object.
27
32
      attr_accessor :type
28
33
 
29
34
      # The name of the argument. Uniquely for display in the help
33
38
      # A small description of the argument
34
39
      attr_accessor :description
35
40
 
 
41
      # The target for the option, in case it is different from its
 
42
      # name
 
43
      attr_accessor :option_target
 
44
 
 
45
      # Whether or not the option is deprecated
 
46
      attr_accessor :option_deprecated
 
47
 
36
48
      # _type_ is a named CommandType
37
49
      def initialize(type, name = nil, desc = nil)
38
50
        @type = CommandType.get_type(type)
39
51
        @name = name
40
52
        @description = desc
 
53
 
 
54
        @option_target = nil
 
55
        @option_deprecated = false
41
56
      end
42
57
      
43
58
      # Returns a name suitable for display in a documentation, such