|
57 | 57 | bin=`dirname "$0"` |
58 | 58 | bin=`cd "$bin">/dev/null; pwd` |
59 | 59 |
|
60 | | -# This will set HBASE_HOME, etc. |
61 | | -. "$bin"/hbase-config.sh |
62 | | - |
63 | | -cygwin=false |
64 | | -case "`uname`" in |
65 | | -CYGWIN*) cygwin=true;; |
66 | | -esac |
67 | | - |
68 | | -# Detect if we are in hbase sources dir |
69 | | -in_dev_env=false |
70 | | -if [ -d "${HBASE_HOME}/target" ]; then |
71 | | - in_dev_env=true |
72 | | -fi |
73 | | - |
74 | | -# Detect if we are in the omnibus tarball |
75 | | -in_omnibus_tarball="false" |
76 | | -if [ -f "${HBASE_HOME}/bin/hbase-daemons.sh" ]; then |
77 | | - in_omnibus_tarball="true" |
78 | | -fi |
79 | | - |
80 | 60 | read -d '' options_string << EOF |
81 | 61 | Options: |
82 | 62 | --config DIR Configuration direction to use. Default: ./conf |
83 | 63 | --hosts HOSTS Override the list in 'regionservers' file |
84 | 64 | --auth-as-server Authenticate to ZooKeeper using servers configuration |
85 | 65 | --internal-classpath Skip attempting to use client facing jars (WARNING: unstable results between versions) |
| 66 | + --help or -h Print this help message |
86 | 67 | EOF |
87 | | -# if no args specified, show usage |
88 | | -if [ $# = 0 ]; then |
| 68 | +show_usage() { |
89 | 69 | echo "Usage: hbase [<options>] <command> [<args>]" |
90 | 70 | echo "$options_string" |
91 | 71 | echo "" |
@@ -122,6 +102,36 @@ if [ $# = 0 ]; then |
122 | 102 | echo " pre-upgrade Run Pre-Upgrade validator tool" |
123 | 103 | echo " hbtop Run HBTop tool" |
124 | 104 | echo " CLASSNAME Run the class named CLASSNAME" |
| 105 | +} |
| 106 | + |
| 107 | +if [ "--help" = "$1" ] || [ "-h" = "$1" ]; then |
| 108 | + show_usage |
| 109 | + exit 0 |
| 110 | +fi |
| 111 | + |
| 112 | +# This will set HBASE_HOME, etc. |
| 113 | +. "$bin"/hbase-config.sh |
| 114 | + |
| 115 | +cygwin=false |
| 116 | +case "`uname`" in |
| 117 | +CYGWIN*) cygwin=true;; |
| 118 | +esac |
| 119 | + |
| 120 | +# Detect if we are in hbase sources dir |
| 121 | +in_dev_env=false |
| 122 | +if [ -d "${HBASE_HOME}/target" ]; then |
| 123 | + in_dev_env=true |
| 124 | +fi |
| 125 | + |
| 126 | +# Detect if we are in the omnibus tarball |
| 127 | +in_omnibus_tarball="false" |
| 128 | +if [ -f "${HBASE_HOME}/bin/hbase-daemons.sh" ]; then |
| 129 | + in_omnibus_tarball="true" |
| 130 | +fi |
| 131 | + |
| 132 | +# if no args specified, show usage |
| 133 | +if [ $# = 0 ]; then |
| 134 | + show_usage |
125 | 135 | exit 1 |
126 | 136 | fi |
127 | 137 |
|
|
0 commit comments