Class: Vkit::CLI::BaseCLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/vkit/cli/base_cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/vkit/cli/base_cli.rb', line 9

def self.exit_on_failure?
  true
end

Instance Method Details

#fetchObject



109
110
111
112
113
114
# File 'lib/vkit/cli/base_cli.rb', line 109

def fetch
  Commands::FetchCommand.new.call(
    grant_ref: options[:grant],
    format: options[:format]
  )
end

#initObject



42
43
44
45
46
47
48
49
# File 'lib/vkit/cli/base_cli.rb', line 42

def init
  packs = options[:with]&.split(",")&.map(&:strip)

  Commands::InitCommand.new.call(
    dir: options[:dir],
    packs: packs
  )
end

#loginObject



17
18
19
20
21
22
# File 'lib/vkit/cli/base_cli.rb', line 17

def 
  Commands::LoginCommand.new(
    endpoint: options[:endpoint],
    email: options[:email]
  ).call
end

#logoutObject



30
31
32
# File 'lib/vkit/cli/base_cli.rb', line 30

def logout
  Commands::LogoutCommand.new.call
end

#requestObject



59
60
61
# File 'lib/vkit/cli/base_cli.rb', line 59

def request
  Commands::RequestCommand.new.call(options[:aql], options)
end

#resetObject



35
36
37
# File 'lib/vkit/cli/base_cli.rb', line 35

def reset
  Commands::ResetCommand.new.call
end

#scan(datasource) ⇒ Object



165
166
167
168
169
170
# File 'lib/vkit/cli/base_cli.rb', line 165

def scan(datasource)
  Commands::ScanCommand.new.call(
    datasource,
    mode: options[:mode]
  )
end

#whoamiObject



25
26
27
# File 'lib/vkit/cli/base_cli.rb', line 25

def whoami
  Commands::WhoamiCommand.new.call
end