This is an automated email from the ASF dual-hosted git repository.

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new 589488d7 [Feature] Add a help prompt to the start.sh (#407)
589488d7 is described below

commit 589488d7f4bb72340ca60f4d8c3b733ea3881b27
Author: Zivissoziv <33108563+zivisso...@users.noreply.github.com>
AuthorDate: Sun Jun 16 16:40:44 2024 +0800

    [Feature] Add a help prompt to the start.sh (#407)
---
 paimon-web-server/src/main/bin/start.sh | 41 ++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/paimon-web-server/src/main/bin/start.sh 
b/paimon-web-server/src/main/bin/start.sh
index cabcf6a8..6d513dfe 100644
--- a/paimon-web-server/src/main/bin/start.sh
+++ b/paimon-web-server/src/main/bin/start.sh
@@ -19,6 +19,34 @@
 PAIMON_UI_HOME="${PAIMON_UI_HOME:-$(pwd)}"
 source ${PAIMON_UI_HOME}/bin/env.sh
 
+
+
+function print_usage {
+    echo "Usage: $0 [--daemon] [--help|-h]"
+    echo ""
+    echo "Options:"
+    echo "  --daemon  Run Paimon Web Server as a background process."
+    echo "  --help|-h Show this help message and exit."
+}
+
+DAEMON=false
+while [[ $# -gt 0 ]]; do
+  case "$1" in
+    --daemon)
+      DAEMON=true
+      ;;
+    --help|-h)
+      print_usage
+      exit 0
+      ;;
+    *)
+      echo "Unsupported parameter: $1"
+      exit 1
+      ;;
+  esac
+  shift
+done
+
 if [[ "$DOCKER" == "true" ]]; then
   JAVA_OPTS="${JAVA_OPTS} -XX:-UseContainerSupport"
 fi
@@ -44,19 +72,6 @@ if [ -z "$ACTION_JAR_PATH" ]; then
     echo "ACTION_JAR_PATH is null, CDC cannot be used normally!"
 fi
 
-DAEMON=false
-while [[ $# -gt 0 ]]; do
-  case "$1" in
-    --daemon)
-      DAEMON=true
-      ;;
-    *)
-      echo "Unsupported parameter: $1"
-      exit 1
-      ;;
-  esac
-  shift
-done
 
 if [ "$DAEMON" = true ]; then
   nohup $JAVA_HOME/bin/java $JAVA_OPTS \

Reply via email to