Class: BranchIOCLI::Command::EnvCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/branch_io_cli/command/env_command.rb

Instance Attribute Summary

Attributes inherited from Command

#config, #options

Instance Method Summary collapse

Methods inherited from Command

available_options, command_name, configuration_class, #env, examples, #helper, #initialize, #patch_helper, return_value, #tool_helper

Constructor Details

This class inherits a constructor from BranchIOCLI::Command::Command

Instance Method Details

#run!Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/branch_io_cli/command/env_command.rb', line 4

def run!
  if config.show_all?
    say "\n" unless config.quiet
    say "<%= color('CLI version:', BOLD) %> #{VERSION}"
    say env.ruby_header(include_load_path: true)
  else
    script_path = env.completion_script
    if script_path.nil?
      say "Completion script not available for #{env.shell}"
      return 1
    end
    puts script_path
  end

  0
end