This is an automated email from the ASF dual-hosted git repository.
lmccay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new 89ae00a KNOX-1742 - add knoxline to knoxshell usage rendering
89ae00a is described below
commit 89ae00a9ee35eeef4a22ae1f4348ab1bb54d511a
Author: lmccay <[email protected]>
AuthorDate: Tue Jan 21 18:37:38 2020 -0500
KNOX-1742 - add knoxline to knoxshell usage rendering
---
gateway-shell-release/home/bin/knoxshell.sh | 4 +++-
.../src/main/java/org/apache/knox/gateway/shell/KnoxSh.java | 9 +++++++--
.../main/java/org/apache/knox/gateway/shell/jdbc/KnoxLine.java | 8 ++++----
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/gateway-shell-release/home/bin/knoxshell.sh
b/gateway-shell-release/home/bin/knoxshell.sh
index 6f8a8fe..b31681c 100755
--- a/gateway-shell-release/home/bin/knoxshell.sh
+++ b/gateway-shell-release/home/bin/knoxshell.sh
@@ -94,8 +94,10 @@ function printHelp {
echo "interactive shell where groovy-based DSL and groovy code may be
entered and executed in realtime."
echo ""
echo "knoxshell usage: "
- echo " knoxshell.sh [[buildTrustStore <knox-gateway-url>|init
<topology-url>|list|destroy|help] | [<script-file-name>]]"
+ echo " knoxshell.sh [[knoxline|buildTrustStore <knox-gateway-url>|init
<topology-url>|list|destroy|help] | [<script-file-name>]]"
echo " ----------------------------------------------------------"
+ echo " knoxline - provides a simple SQL/JDBC client"
+ echo " example: knoxshell.sh knoxline"
echo " buildTrustStore <knox-gateway-url> - downloads the given gateway
server's public certificate and builds a trust store to be used by KnoxShell"
echo " example: knoxshell.sh buildTrustStore https://localhost:8443/"
echo " init <topology-url> - requests a session from the knox token
service at the url"
diff --git
a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
index da767d1..205b800 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
@@ -66,7 +66,8 @@ public class KnoxSh {
" [" + KnoxBuildTrustStore.USAGE + "]\n" +
" [" + KnoxInit.USAGE + "]\n" +
" [" + KnoxDestroy.USAGE + "]\n" +
- " [" + KnoxList.USAGE + "]\n";
+ " [" + KnoxList.USAGE + "]\n" +
+ " [" + KnoxLineCommand.USAGE + "]\n";
/** allows stdout to be captured if necessary */
PrintStream out = System.out;
@@ -148,7 +149,8 @@ public class KnoxSh {
out.println( USAGE_PREFIX + "\n" + COMMANDS );
if ( command != null ) {
out.println(command.getUsage());
- } else {
+ }
+ else {
char[] chars = new char[79];
Arrays.fill( chars, '=' );
String div = new String( chars );
@@ -163,6 +165,9 @@ public class KnoxSh {
out.println(KnoxList.USAGE + "\n\n" + KnoxList.DESC);
out.println();
out.println( div );
+ out.println(KnoxLineCommand.USAGE + "\n\n" + KnoxLineCommand.DESC);
+ out.println();
+ out.println( div );
}
}
diff --git
a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/jdbc/KnoxLine.java
b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/jdbc/KnoxLine.java
index bf8ef94..0afb9d9 100644
---
a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/jdbc/KnoxLine.java
+++
b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/jdbc/KnoxLine.java
@@ -32,10 +32,10 @@ import org.apache.knox.gateway.shell.KnoxSession;
import org.apache.knox.gateway.shell.table.KnoxShellTable;
public class KnoxLine {
- String user;
- String pass;
- KnoxDataSource datasource;
- Connection conn;
+ private String user;
+ private String pass;
+ private KnoxDataSource datasource;
+ private Connection conn;
@SuppressWarnings("PMD.DoNotUseThreads") // we need to define a Thread to be
able to register a shutdown hook
public void execute(String[] args)