Class: SecureKeys::Validation::Console::Argument::Scan::Parser
- Inherits:
-
OptionParser
- Object
- OptionParser
- SecureKeys::Validation::Console::Argument::Scan::Parser
- 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
-
#initialize ⇒ Parser
constructor
Initialize the scan parser, process ARGV, and store results in Handler.
Constructor Details
#initialize ⇒ Parser
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 |