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,Metrics/MethodLength.
Class Method Details
.start(args) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/holivia/cli.rb', line 18 def self.start(args) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength 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 "appointment" then Commands::Appointment.route(args) when "communication" then Commands::CommunicationItem.route(args) when "intervention" then Commands::InterventionItem.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 |