Repository navigation
Expand file tree
/
Copy pathcli.rb
More file actions
42 lines (40 loc) · 1.3 KB
/
Copy pathcli.rb
File metadata and controls
42 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'thor'
module Salus
class CLI < Thor
class_option :config,
aliases: ['-c'],
desc: 'Point to local or remote configuration files. '\
'e.g. --config="file://path/to/salus.yaml"',
type: :string,
default: ''
class_option :quiet,
aliases: ['-q'],
desc: 'Do not print reports to STDOUT.',
type: :boolean,
default: false
class_option :verbose,
aliases: ['-v'],
desc: 'Include "info" level data in reports printed to STDOUT.',
type: :boolean,
default: false
class_option :repo_path,
aliases: ['-d'],
desc: 'Path to a directory to scan.',
type: :string,
default: './repo'
class_option :no_colors,
desc: 'Do not colorize output.',
type: :boolean,
default: false
desc 'scan', 'Scan the source code of a repository.'
def scan
Salus.scan(
config: options[:config],
quiet: options[:quiet],
verbose: options[:verbose],
repo_path: options[:repo_path],
use_colors: !options[:no_colors]
)
end
end
end