Class: MetzScan::Commands::ScanOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/metz_scan/commands/scan.rb

Defined Under Namespace

Classes: Options

Constant Summary collapse

USAGE =
"Usage: metz-scan scan PATH... [--format text|json|sarif|gh-annotations] " \
"[--all-cops] [--project-analyzers] [--auto-fix [--unsafe] [--dry-run]]"
VALID_FORMATS =
%w[text json sarif gh-annotations].freeze
DEFAULT_FORMAT =
"text"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.helpObject



30
31
32
# File 'lib/metz_scan/commands/scan.rb', line 30

def self.help
  new.help
end

.parse(argv) ⇒ Object



26
27
28
# File 'lib/metz_scan/commands/scan.rb', line 26

def self.parse(argv)
  new.parse(argv)
end

Instance Method Details

#helpObject



40
41
42
# File 'lib/metz_scan/commands/scan.rb', line 40

def help
  option_parser(default_flags).help
end

#parse(argv) ⇒ Object



34
35
36
37
38
# File 'lib/metz_scan/commands/scan.rb', line 34

def parse(argv)
  flags = default_flags
  paths = option_parser(flags).parse(argv)
  Options.new(**flags, paths: paths)
end