ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [12/51] incubator-ignite git commit: # IGNITE-704 Added support for "--help", added "-np" option to help and added "-np" to ggvisorui.exe.
Date Fri, 10 Apr 2015 12:10:47 GMT
# IGNITE-704 Added support for "--help", added "-np" option to help and added "-np" to ggvisorui.exe.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c0e6cd51
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c0e6cd51
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c0e6cd51

Branch: refs/heads/ignite-537
Commit: c0e6cd51ce1fe2d50bb084fdfd574abad7d66033
Parents: 86c3bc5
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Thu Apr 9 22:20:05 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Thu Apr 9 22:20:05 2015 +0700

----------------------------------------------------------------------
 bin/ignitevisorcmd.bat                          | 39 +++++++++++---------
 .../startup/cmdline/CommandLineStartup.java     |  7 ++--
 .../ignite/visor/commands/VisorConsole.scala    | 19 ++++++++++
 3 files changed, 44 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c0e6cd51/bin/ignitevisorcmd.bat
----------------------------------------------------------------------
diff --git a/bin/ignitevisorcmd.bat b/bin/ignitevisorcmd.bat
index 717233b..1cf2b26 100644
--- a/bin/ignitevisorcmd.bat
+++ b/bin/ignitevisorcmd.bat
@@ -24,30 +24,34 @@
 if "%OS%" == "Windows_NT"  setlocal
 
 :: Check JAVA_HOME.
-if not "%JAVA_HOME%" == "" goto checkJdk
-    echo %0, ERROR: JAVA_HOME environment variable is not found.
-    echo %0, ERROR: Please create JAVA_HOME variable pointing to location of JDK 1.7 or JDK
1.8.
-    echo %0, ERROR: You can also download latest JDK at: http://java.sun.com/getjava
+if defined JAVA_HOME  goto checkJdk
+    echo %0, ERROR:
+    echo JAVA_HOME environment variable is not found.
+    echo Please point JAVA_HOME variable to location of JDK 1.7 or JDK 1.8.
+    echo You can also download latest JDK at http://java.com/download.
 goto error_finish
 
 :checkJdk
 :: Check that JDK is where it should be.
 if exist "%JAVA_HOME%\bin\java.exe" goto checkJdkVersion
-    echo %0, ERROR: The JDK is not found in %JAVA_HOME%.
-    echo %0, ERROR: Please modify your script so that JAVA_HOME would point to valid location
of JDK.
+    echo %0, ERROR:
+    echo JAVA is not found in JAVA_HOME=%JAVA_HOME%.
+    echo Please point JAVA_HOME variable to installation of JDK 1.7 or JDK 1.8.
+    echo You can also download latest JDK at http://java.com/download.
 goto error_finish
 
 :checkJdkVersion
 "%JAVA_HOME%\bin\java.exe" -version 2>&1 | findstr "1\.[78]\." > nul
 if %ERRORLEVEL% equ 0 goto checkIgniteHome1
-    echo %0, ERROR: The version of JAVA installed in %JAVA_HOME% is incorrect.
-    echo %0, ERROR: Please install JDK 1.7 or 1.8.
-    echo %0, ERROR: You can also download latest JDK at: http://java.sun.com/getjava
+    echo %0, ERROR:
+    echo The version of JAVA installed in %JAVA_HOME% is incorrect.
+    echo Please point JAVA_HOME variable to installation of JDK 1.7 or JDK 1.8.
+    echo You can also download latest JDK at http://java.com/download.
 goto error_finish
 
 :: Check IGNITE_HOME.
 :checkIgniteHome1
-if not "%IGNITE_HOME%" == "" goto checkIgniteHome2
+if defined IGNITE_HOME goto checkIgniteHome2
     pushd "%~dp0"/..
     set IGNITE_HOME=%CD%
     popd
@@ -82,10 +86,15 @@ set SCRIPTS_HOME=%IGNITE_HOME%\bin
 :: Remove trailing spaces
 for /l %%a in (1,1,31) do if /i "%SCRIPTS_HOME:~-1%" == " " set SCRIPTS_HOME=%SCRIPTS_HOME:~0,-1%
 
-if /i "%SCRIPTS_HOME%\" == "%~dp0" goto run
+if /i "%SCRIPTS_HOME%\" == "%~dp0" goto setProgName
     echo %0, WARN: IGNITE_HOME environment variable may be pointing to wrong folder: %IGNITE_HOME%
 
-:run
+:setProgName
+::
+:: Set program name.
+::
+set PROG_NAME=ignitevisorcmd.bat
+if "%OS%" == "Windows_NT" set PROG_NAME=%~nx0%
 
 ::
 :: Set IGNITE_LIBS
@@ -104,12 +113,6 @@ if %ERRORLEVEL% neq 0 (
 )
 
 ::
-:: Set program name.
-::
-set PROG_NAME=ignite.bat
-if "%OS%" == "Windows_NT" set PROG_NAME=%~nx0%
-
-::
 :: JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more
details.
 ::
 :: ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c0e6cd51/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
index 6a0709d..f286cd3 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
@@ -154,10 +154,11 @@ public final class CommandLineStartup {
 
             X.error(
                 "Usage:",
-                "    " + runner + (ignite ? " [?]|[path {-v}]|[-i]" : " [?]|[-v]"),
+                "    " + runner + (ignite ? " [?]|[path {-v}{-np}]|[-i]" : " [?]|[-v]"),
                 "    Where:",
-                "    ?, /help, -help - show this message.",
-                "    -v              - verbose mode (quiet by default).");
+                "    ?, /help, -help, - show this message.",
+                "    -v               - verbose mode (quiet by default).",
+                "    -np              - no pause on exit (pause by default)");
 
             if (ignite) {
                 X.error(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c0e6cd51/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index 569320c..1d5c4b8 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -147,6 +147,25 @@ object VisorConsole extends App {
     reader.addCompleter(new VisorCommandCompleter(visor.commands))
     reader.addCompleter(new VisorFileNameCompleter())
 
+    private def isHelp(arg: String): Boolean = {
+        val s = arg.trim.toLowerCase
+
+        "?" == s || s.endsWith("help")
+    }
+
+    if (args.length > 0 && isHelp(args(0))) {
+        println("Usage:")
+        println("    ignitevisorcmd [?]|[{-v}{-np}]|[{-b=<batch commands file path>}
{-e=command1;command2}]")
+        println("    Where:")
+        println("        ?, /help, -help - show this message.")
+        println("        -v              - verbose mode (quiet by default).")
+        println("        -np             - no pause on exit (pause by default)")
+        println("        -b              - batch mode with file)")
+        println("        -e              - batch mode with commands)")
+
+        System.exit(0)
+    }
+
     welcomeMessage()
 
     private var ok = true


Mime
View raw message