Class: Holivia::CLI
- Inherits:
-
Object
- Object
- Holivia::CLI
- Defined in:
- lib/holivia/cli.rb,
lib/holivia/cli/help.rb
Defined Under Namespace
Modules: Help
Class Method Summary collapse
-
.start(args) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity.
Class Method Details
.start(args) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/holivia/cli.rb', line 15 def self.start(args) # rubocop:disable Metrics/CyclomaticComplexity command = args.shift case command when "login" then Commands::Auth.new.login(args) when "logout" then Commands::Auth.new.logout when "env" then Commands::Env.route(args) when "selfcare" then Commands::Selfcare.route(args) when "objective" then Commands::Objective.route(args) when "version", "--version", "-v" then puts "holivia #{Holivia::VERSION}" when "--help", "-h", nil then puts Help::HELP_TEXT else warn "Unknown command: #{command}" exit 1 end end |