class ChefCLI::Command::ShellInit

def run(argv)

def run(argv)
  # Currently we don't have any shell-specific features, so we ignore the
  # shell name. We'll need it if we add completion.
  remaining_args = parse_options(argv)
  shell_name = remaining_args.first
  if shell_name.nil?
    err("Please specify what shell you are using\n")
    err(opt_parser.to_s)
    return 1
  elsif !SUPPORTED_SHELLS.include?(shell_name)
    err("Shell `#{shell_name}' is not currently supported")
    err("Supported shells are: #{SUPPORTED_SHELLS.join(" ")}")
    return 1
  end
  env = omnibus_env.dup
  path = env.delete("PATH")
  export(shell_name, "PATH", path)
  env.each do |var_name, value|
    export(shell_name, var_name, value)
  end
  emit_shell_cmd(completion_for(shell_name))
  0
end