Class: SecureKeys::Validation::Console::Argument::Scan::Parser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/validation/console/arguments/scan/parser.rb

Overview

Parses CLI options for the ‘secure-keys validate scan` subcommand. Uses parse! so options and positional arguments may appear in any order; after parsing, any remaining ARGV token is treated as the scan path.

Instance Method Summary collapse

Constructor Details

#initializeParser

Initialize the scan parser, process ARGV, and store results in Handler



17
18
19
20
21
22
23
# File 'lib/validation/console/arguments/scan/parser.rb', line 17

def initialize
  super('Usage: secure-keys validate scan [path] [--options]')
  separator('')
  configure!
  parse!(into: Handler.arguments)
  Handler.set(key: :path, value: ARGV.shift) unless ARGV.empty?
end