Module: Rakit::CLI::WordCloud

Defined in:
lib/rakit/cli/word_cloud.rb

Class Method Summary collapse

Class Method Details

.run(argv) ⇒ Integer

Returns exit code.

Parameters:

  • argv (Array<String>)

    arguments after “word-cloud”

Returns:

  • (Integer)

    exit code



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rakit/cli/word_cloud.rb', line 13

def run(argv)
  return usage_stderr("Expected command: status | install | generate") if argv.empty?

  cmd = argv.shift
  case cmd
  when "status" then run_status(argv)
  when "install" then run_install(argv)
  when "generate" then run_generate(argv)
  else
    $stderr.puts "Unknown command: #{cmd}"
    1
  end
end