~ubuntu-branches/ubuntu/wily/rbenv/wily

« back to all changes in this revision

Viewing changes to libexec/rbenv-help

  • Committer: Package Import Robot
  • Author(s): Antonio Terceiro
  • Date: 2011-09-24 12:27:44 UTC
  • Revision ID: package-import@ubuntu.com-20110924122744-gpszt0huloxxzu6f
Tags: upstream-0.1.2+git20100922
ImportĀ upstreamĀ versionĀ 0.1.2+git20100922

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
set -e
 
3
[ -n "$RBENV_DEBUG" ] && set -x
 
4
 
 
5
print_set_version() {
 
6
  echo "<version> should be a string matching a Ruby version known by rbenv."
 
7
 
 
8
  local versions="$(rbenv-versions --bare)"
 
9
  if [ -z "$versions" ]; then
 
10
    echo "There are currently no Ruby versions installed for rbenv."
 
11
  else
 
12
    echo "The currently installed Ruby versions are:"
 
13
    echo "$versions" | sed 's/^/  /'
 
14
  fi
 
15
 
 
16
  echo
 
17
  echo "The special version string 'system' will use your default system Ruby."
 
18
}
 
19
 
 
20
case "$1" in
 
21
"") echo "usage: rbenv <command> [<args>]
 
22
 
 
23
Some useful rbenv commands are:
 
24
   commands      List all commands
 
25
   rehash        Rehash rbenv shims (run this after installing binaries)
 
26
   global        Set or show the global Ruby version
 
27
   local         Set or show the local directory-specific Ruby version
 
28
   version       Show the current Ruby version
 
29
   versions      List all Ruby versions known by rbenv
 
30
 
 
31
See 'rbenv help <command>' for more information on a specific command.
 
32
For more information, see: https://github.com/sstephenson/rbenv#readme"
 
33
;;
 
34
global) echo "usage: rbenv global <version>
 
35
 
 
36
Sets the global Ruby version. You can override the global version at
 
37
any time by setting a directory-specific version with \`rbenv local'
 
38
or by setting the RBENV_VERSION environment variable.
 
39
 
 
40
$(print_set_version)"
 
41
;;
 
42
local) echo "usage: rbenv local <version>
 
43
 
 
44
Sets the local directory-specific Ruby version by writing the version
 
45
name to a file named '.rbenv-version'.
 
46
 
 
47
When you run a Ruby command, rbenv will look for an '.rbenv-version'
 
48
file in the current directory and each parent directory. If no such
 
49
file is found in the tree, rbenv will use the global Ruby version
 
50
specified with \`rbenv global', or the version specified in the
 
51
RBENV_VERSION environment variable.
 
52
 
 
53
$(print_set_version)"
 
54
;;
 
55
*) echo "No command arguments needed or invalid/undocumented command."
 
56
esac