You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/02/22 17:18:11 UTC
[pulsar] branch master updated: [Issue 3409] Support '--help'
option of Pulsar command-line tools (#3410)
This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new c0ffa16 [Issue 3409] Support '--help' option of Pulsar command-line tools (#3410)
c0ffa16 is described below
commit c0ffa16affba42197ec167ae87967884cdbac5ce
Author: Fangbin Sun <su...@gmail.com>
AuthorDate: Sat Feb 23 01:18:06 2019 +0800
[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
---
bin/bookkeeper | 2 +-
bin/pulsar | 2 +-
bin/pulsar-daemon | 13 ++++++++++---
bin/pulsar-perf | 6 +++---
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/bin/bookkeeper b/bin/bookkeeper
index ef7793a..7024e65 100755
--- a/bin/bookkeeper
+++ b/bin/bookkeeper
@@ -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 $@
diff --git a/bin/pulsar b/bin/pulsar
index 5544ff0..50b27d6 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -333,7 +333,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 ""
diff --git a/bin/pulsar-daemon b/bin/pulsar-daemon
index 2e01eab..89c66a9 100755
--- a/bin/pulsar-daemon
+++ b/bin/pulsar-daemon
@@ -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
diff --git a/bin/pulsar-perf b/bin/pulsar-perf
index 7c32843..af2d010 100755
--- a/bin/pulsar-perf
+++ b/bin/pulsar-perf
@@ -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