#!/bin/bash
if [ -z "$GVM_ROOT" ]; then
  echo 'ERROR: $GVM_ROOT is not set! Please update your .bashrc or .profile to $

  [[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"

  '
  exit 1
fi

if [[ $1 == "implode" ]]; then
  rm -rf $GVM_ROOT
  exit 0
fi

$GVM_ROOT/bin/gvm-check
if [[ "$?" != "0" ]]; then
  echo "ERROR: Missing requirements. Please see messages above"
  exit 1
fi

if [[ $1 == "version" ]]; then
  echo "Go Version Manager v$GVM_VERSION"
else
  if [ -f $GVM_ROOT/bin/gvm-$1 ]; then
    $GVM_ROOT/bin/gvm-$1 $@
  elif [[ -n $1 ]]; then
    echo "ERROR: Unrecognized command line argument: '$1'"
  else
    echo "= gvm

* http://github.com/moovweb/gvm

== DESCRIPTION:

GVM is the Go Version Manager

== Usage

  gvm Command

== Command

  version    - print the gvm version number
  get        - gets the latest code (for debugging)
  use        - select a go version to use
  implode    - completely remove gvm
  install    - install go versions
  uninstall  - uninstall go versions
  list       - list installed go versions
  pkgset     - manage go packages sets
  pkg        - manage go packages"
  fi
fi
