Class: MxxRu::Cpp::Mode::OptionParser

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/mxx_ru/cpp/mode.rb

Overview

Option parser for C++ specific Mxx_ru options.

Since v.1.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptionParser

Returns a new instance of OptionParser.



59
60
61
62
63
64
65
# File 'lib/mxx_ru/cpp/mode.rb', line 59

def initialize
  @is_release = false
  @is_debug = false
  @is_only_one = false
  @is_no_depends_analyzer = false
  @is_option_extraction = false
end

Instance Attribute Details

#is_debugObject (readonly)

Returns the value of attribute is_debug.



54
55
56
# File 'lib/mxx_ru/cpp/mode.rb', line 54

def is_debug
  @is_debug
end

#is_no_depends_analyzerObject (readonly)

Returns the value of attribute is_no_depends_analyzer.



56
57
58
# File 'lib/mxx_ru/cpp/mode.rb', line 56

def is_no_depends_analyzer
  @is_no_depends_analyzer
end

#is_only_oneObject (readonly)

Returns the value of attribute is_only_one.



55
56
57
# File 'lib/mxx_ru/cpp/mode.rb', line 55

def is_only_one
  @is_only_one
end

#is_option_extractionObject (readonly)

Returns the value of attribute is_option_extraction.



57
58
59
# File 'lib/mxx_ru/cpp/mode.rb', line 57

def is_option_extraction
  @is_option_extraction
end

#is_releaseObject (readonly)

Returns the value of attribute is_release.



53
54
55
# File 'lib/mxx_ru/cpp/mode.rb', line 53

def is_release
  @is_release
end

Instance Method Details

#prepare(parser) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mxx_ru/cpp/mode.rb', line 67

def prepare( parser )
  parser.separator ''
  parser.separator 'C++ mode options:'

  parser.on( MXXCPPARG_RELEASE, 'Compile in release mode' ) do
    @is_release = true
  end

  parser.on( MXXCPPARG_DEBUG, 'Compile in debug mode' ) do
    @is_debug = true
  end

  parser.on( MXXCPPARG_ONLY_ONE,
      'Process only one project, without required projects' ) do
    @is_only_one = true
  end

  parser.on( MXXCPPARG_NO_DEPENDS_ANALYZER,
      'Do not use C++ dependencies analyzer' ) do
    @is_no_depends_analyzer = true
  end

  parser.on( MXXCPPARG_EXTRACT_OPTIONS,
      'Only extract and show tools (like compiler, linker) options' ) do
    @is_option_extraction = true
  end
end