提交 043f32f8 编写于 作者: F Fangbin Sun 提交者: Matteo Merli

[Issue 3409] Support '--help' option of Pulsar command-line tools (#3410)

* Support '--help' option of Pulsar command-line tools.

* Fix a indentation

* Fix a minor bug
上级 40a3aafa
......@@ -195,7 +195,7 @@ elif [ $COMMAND == "upgrade" ]; then
elif [ $COMMAND == "shell" ]; then
ENTRY_FORMATTER_ARG="-DentryFormatterClass=${ENTRY_FORMATTER_CLASS:-org.apache.bookkeeper.util.StringEntryFormatter}"
exec $JAVA $OPTS $ENTRY_FORMATTER_ARG org.apache.bookkeeper.bookie.BookieShell -conf $BOOKIE_CONF $@
elif [ $COMMAND == "help" ]; then
elif [ $COMMAND == "help" -o $COMMAND == "--help" -o $COMMAND == "-h" ]; then
bookkeeper_help;
else
exec $JAVA $OPTS $COMMAND $@
......
......@@ -334,7 +334,7 @@ elif [ $COMMAND == "sql-worker" ]; then
exec ${PRESTO_HOME}/bin/launcher --etc-dir ${PULSAR_PRESTO_CONF} "${@}"
elif [ $COMMAND == "tokens" ]; then
exec $JAVA $OPTS org.apache.pulsar.utils.auth.tokens.TokensCliUtils $@
elif [ $COMMAND == "help" ]; then
elif [ $COMMAND == "help" -o $COMMAND == "--help" -o $COMMAND == "-h" ]; then
pulsar_help;
else
echo ""
......
......@@ -50,11 +50,18 @@ PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"RollingFile"}
PULSAR_STOP_TIMEOUT=${PULSAR_STOP_TIMEOUT:-30}
PULSAR_PID_DIR=${PULSAR_PID_DIR:-$PULSAR_HOME/bin}
if [ $# -lt 2 ]
then
echo "Error: no enough arguments provided."
if [ $# = 0 ]; then
usage
exit 1
elif [ $# = 1 ]; then
if [ $1 == "--help" -o $1 == "-h" ]; then
usage
exit 1
else
echo "Error: no enough arguments provided."
usage
exit 1
fi
fi
startStop=$1
......
......@@ -74,7 +74,7 @@ add_maven_deps_to_classpath() {
}
pulsar_help() {
cat <<EOF
Usage: pulsar <command>
Usage: pulsar-perf <command>
where command is one of:
produce Run a producer
consume Run a consumer
......@@ -87,13 +87,13 @@ where command is one of:
simulation-client Run a simulation server acting as a Pulsar client
simulation-controller Run a simulation controller to give commands to servers
help This help message
help This help message
or command is the full name of a class with a defined main() method.
Environment variables:
PULSAR_LOG_CONF Log4j configuration file (default $DEFAULT_LOG_CONF)
PULSAR_CLIENT_CONF Configuration file for client (default: $DEFAULT_CLIENT_CONF)
PULSAR_CLIENT_CONF Configuration file for client (default: $DEFAULT_CLIENT_CONF)
PULSAR_EXTRA_OPTS Extra options to be passed to the jvm
PULSAR_EXTRA_CLASSPATH Add extra paths to the pulsar classpath
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册