Class: SeccompTools::CLI::Base

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

Asm, Audit, Completion, Disasm, Dump, Emu, Explain

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Base

Instantiate a SeccompTools::CLI::Base object.

Parameters:

  • argv (Array<String>)

    Arguments array.



25
26
27
28
# File 'lib/seccomp-tools/cli/base.rb', line 25

def initialize(argv)
  @option = {}
  @argv = argv
end

Instance Attribute Details

#argvArray<String> (readonly)

Returns Arguments array.

Returns:

  • (Array<String>)

    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.

Returns:

  • ({Symbol => Object})

    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