Class: SeccompTools::CLI::Base
- Inherits:
-
Object
- Object
- SeccompTools::CLI::Base
- Defined in:
- lib/seccomp-tools/cli/base.rb
Overview
Base class for handlers.
Each subcommand is a subclass that defines a USAGE constant and a parser, and overrides
#handle to do its work.
Instance Attribute Summary collapse
-
#argv ⇒ Array<String>
readonly
Arguments array.
-
#option ⇒ {Symbol => Object}
readonly
Options parsed from the command line.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Base
constructor
Instantiate a Base object.
Constructor Details
#initialize(argv) ⇒ Base
Instantiate a SeccompTools::CLI::Base object.
25 26 27 28 |
# File 'lib/seccomp-tools/cli/base.rb', line 25 def initialize(argv) @option = {} @argv = argv end |
Instance Attribute Details
#argv ⇒ Array<String> (readonly)
Returns Arguments array.
20 21 22 |
# File 'lib/seccomp-tools/cli/base.rb', line 20 def argv @argv end |
#option ⇒ {Symbol => Object} (readonly)
Returns Options parsed from the command line. Common keys are :arch, :ifile, :ofile,
:format, :limit, :pid and :verbose, depending on the subcommand.
18 19 20 |
# File 'lib/seccomp-tools/cli/base.rb', line 18 def option @option end |