/** * Primary entry point for the KeyShell; called via main(). * * @param args Command line arguments. * @return 0 on success and 1 on failure. This value is passed back to * the unix shell, so we must follow shell return code conventions: * the return code is an unsigned character, and 0 means success, and * small positive integers mean failure. * @throws Exception */ @Override public int run(String[] args) throws Exception { int exitCode = 0; try { exitCode = init(args); if (exitCode != 0) { return exitCode; } if (command.validate()) { command.execute(); } else { exitCode = 1; } } catch (Exception e) { e.printStackTrace(err); return 1; } return exitCode; }
/** * Primary entry point for the KeyShell; called via main(). * * @param args Command line arguments. * @return 0 on success and 1 on failure. This value is passed back to * the unix shell, so we must follow shell return code conventions: * the return code is an unsigned character, and 0 means success, and * small positive integers mean failure. * @throws Exception */ @Override public int run(String[] args) throws Exception { int exitCode = 0; try { exitCode = init(args); if (exitCode != 0) { return exitCode; } if (command.validate()) { command.execute(); } else { exitCode = 1; } } catch (Exception e) { e.printStackTrace(err); return 1; } return exitCode; }
/** * Primary entry point for the KeyShell; called via main(). * * @param args Command line arguments. * @return 0 on success and 1 on failure. This value is passed back to * the unix shell, so we must follow shell return code conventions: * the return code is an unsigned character, and 0 means success, and * small positive integers mean failure. * @throws Exception */ @Override public int run(String[] args) throws Exception { int exitCode = 0; try { exitCode = init(args); if (exitCode != 0) { return exitCode; } if (command.validate()) { command.execute(); } else { exitCode = 1; } } catch (Exception e) { e.printStackTrace(err); return 1; } return exitCode; }
/** * Primary entry point for the KeyShell; called via main(). * * @param args Command line arguments. * @return 0 on success and 1 on failure. This value is passed back to * the unix shell, so we must follow shell return code conventions: * the return code is an unsigned character, and 0 means success, and * small positive integers mean failure. * @throws Exception */ @Override public int run(String[] args) throws Exception { int exitCode = 0; try { exitCode = init(args); if (exitCode != 0) { return exitCode; } if (command.validate()) { command.execute(); } else { exitCode = 1; } } catch (Exception e) { e.printStackTrace(err); return 1; } return exitCode; }