Class: Ccfg::Application

Inherits:
Object
  • Object
show all
Includes:
Ccfg
Defined in:
lib/ccfg/application.rb

Overview

Class for application control methods.

Constant Summary

Constants included from Ccfg

CCONFIGURE_DEFINE_DIRECTIVE, VERSION

Instance Method Summary collapse

Constructor Details

#initializeApplication

Returns a new instance of Application.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ccfg/application.rb', line 7

def initialize
  # Create application.
  @app = Cmdlib::App.new( 'ccfg' )
  @app.about << 'Command line tool to generate C/C++ configure files.'
  @app.usage << 'ccfg <input file> -o <output file> [DEFINITION LIST...].'
  # Add options to application.
  @app.addopt Cmdlib::Option.new( 'o', 'output', 'Option set output file (default STDOUT).', true )
  # Add commands to application.
  @app.default Handler.new
  # Start application.
  @app.run
end