mirror of
https://github.com/apache/sqoop.git
synced 2025-05-05 06:12:25 +08:00
SQOOP-811: Client shell variable substitution for recent commands
(Vasanth kumar RJ via Jarek Jarcec Cecho)
This commit is contained in:
parent
53688b54b5
commit
2016dedce6
@ -42,7 +42,7 @@ public CloneCommand(Shell shell) {
|
|||||||
Constants.PRE_CLONE, Constants.SUF_INFO);
|
Constants.PRE_CLONE, Constants.SUF_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_CLONE_USAGE), getUsage());
|
.RES_CLONE_USAGE), getUsage());
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public CreateCommand(Shell shell) {
|
|||||||
Constants.PRE_CREATE, Constants.SUF_INFO);
|
Constants.PRE_CREATE, Constants.SUF_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_CREATE_USAGE), getUsage());
|
.RES_CREATE_USAGE), getUsage());
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public DeleteCommand(Shell shell) {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_DELETE_USAGE), getUsage());
|
.RES_DELETE_USAGE), getUsage());
|
||||||
if (args.size() == 0) {
|
if (args.size() == 0) {
|
||||||
|
@ -40,7 +40,7 @@ protected SetCommand(Shell shell) {
|
|||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@Override
|
@Override
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_SET_USAGE), getUsage());
|
.RES_SET_USAGE), getUsage());
|
||||||
|
|
||||||
@ -49,7 +49,6 @@ public Object execute(List args) {
|
|||||||
io.out.println();
|
io.out.println();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
resolveVariables(args);
|
|
||||||
String func = (String)args.get(0);
|
String func = (String)args.get(0);
|
||||||
if (func.equals(Constants.FN_SERVER)) {
|
if (func.equals(Constants.FN_SERVER)) {
|
||||||
if (serverFunction == null) {
|
if (serverFunction == null) {
|
||||||
|
@ -47,7 +47,7 @@ protected ShowCommand(Shell shell) {
|
|||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@Override
|
@Override
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_SHOW_USAGE), getUsage());
|
.RES_SHOW_USAGE), getUsage());
|
||||||
if (args.size() == 0) {
|
if (args.size() == 0) {
|
||||||
|
@ -126,6 +126,22 @@ public String getHelp() {
|
|||||||
return help;
|
return help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override execute method
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object execute(List args) {
|
||||||
|
resolveVariables(args);
|
||||||
|
return executeCommand(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract executeCommand
|
||||||
|
* @param args list
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
public abstract Object executeCommand(List args);
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
protected void resolveVariables(List arg) {
|
protected void resolveVariables(List arg) {
|
||||||
List temp = new ArrayList();
|
List temp = new ArrayList();
|
||||||
|
@ -43,7 +43,7 @@ public SubmissionCommand(Shell shell) {
|
|||||||
Constants.PRE_SUBMISSION, Constants.SUF_INFO);
|
Constants.PRE_SUBMISSION, Constants.SUF_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_SUBMISSION_USAGE), getUsage());
|
.RES_SUBMISSION_USAGE), getUsage());
|
||||||
if (args.size() == 0) {
|
if (args.size() == 0) {
|
||||||
|
@ -40,7 +40,7 @@ public UpdateCommand(Shell shell) {
|
|||||||
Constants.PRE_UPDATE, Constants.SUF_INFO);
|
Constants.PRE_UPDATE, Constants.SUF_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object execute(List args) {
|
public Object executeCommand(List args) {
|
||||||
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
String usageMsg = MessageFormat.format(getResource().getString(Constants
|
||||||
.RES_UPDATE_USAGE), getUsage());
|
.RES_UPDATE_USAGE), getUsage());
|
||||||
if (args.size() == 0) {
|
if (args.size() == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user