@@ -55,6 +55,38 @@ get_java_cmd() {
5555 fi
5656}
5757
58+ # Processes incoming arguments and places them in appropriate global variables. called by the run method.
59+ process_args () {
60+ local no_more_snp_opts=0
61+ while [[ $# -gt 0 ]]; do
62+ case " $1 " in
63+ --) shift && no_more_snp_opts=1 && break ;;
64+ -h|-help) usage; exit 1 ;;
65+ -v|-verbose) verbose=1 && shift ;;
66+ -d|-debug) debug=1 && shift ;;
67+
68+ -no-version-check) no_version_check=1 && shift ;;
69+
70+ -mem) echo " !! WARNING !! -mem option is ignored. Please use -J-Xmx and -J-Xms" && shift 2 ;;
71+ -jvm-debug) require_arg port " $1 " " $2 " && addDebugger $2 && shift 2 ;;
72+
73+ -main) custom_mainclass=" $2 " && shift 2 ;;
74+
75+ -java-home) require_arg path " $1 " " $2 " && jre=` eval echo $2 ` && java_cmd=" $jre /bin/java" && shift 2 ;;
76+
77+ -D* |-agentlib* |-XX* ) addJava " $1 " && shift ;;
78+ -J* ) addJava " ${1: 2} " && shift ;;
79+ * ) addResidual " $1 " && shift ;;
80+ esac
81+ done
82+
83+ if [[ no_more_snp_opts ]]; then
84+ while [[ $# -gt 0 ]]; do
85+ addResidual " $1 " && shift
86+ done
87+ fi
88+ }
89+
5890real_script_path=" $( realpath " $0 " ) "
5991app_home=" $( realpath " $( dirname " $real_script_path " ) " ) "
6092lib_dir=" $( realpath " ${app_home} /../lib" ) "
@@ -63,6 +95,8 @@ app_mainclass=${{app_mainclass}}
6395
6496${{template_declares} }
6597
98+ process_args " $@ "
99+
66100java_cmd=" $( get_java_cmd) "
67101
68102# If a configuration file exist, read the contents to $opts
0 commit comments