ss.out.println(s+" is undefined");
}
}
public int run(String command) {
SessionState ss = SessionState.get();
String nwcmd = command.trim();
if(nwcmd.equals("")) {
dumpOptions(ss.getConf().getChangedProperties());
return 0;
}
if(nwcmd.equals("-v")) {
dumpOptions(ss.getConf().getAllProperties());
return 0;
}
String[] part = new String [2];
int eqIndex = nwcmd.indexOf('=');
if(eqIndex == -1) {
// no equality sign - print the property out
dumpOption(ss.getConf().getAllProperties(), nwcmd);
return (0);
} else if (eqIndex == nwcmd.length()-1) {
part[0] = nwcmd.substring(0, nwcmd.length()-1);
part[1] = "";
} else {
part[0] = nwcmd.substring(0, eqIndex).trim();
part[1] = nwcmd.substring(eqIndex+1).trim();
}
try {
if (part[0].equals("silent")) {
boolean val = getBoolean(part[1]);
ss.setIsSilent(val);
} else {
ss.getConf().set(part[0], part[1]);
}
} catch (IllegalArgumentException err) {
ss.err.println(err.getMessage());
return 1;
}