Minor beautifying of the dsconfig interactive mode.
| | |
| | | String ninput = input.toLowerCase().trim(); |
| | | if (ninput.length() == 0) { |
| | | // Empty input. |
| | | app.println(); |
| | | app.printMessage(errMsg); |
| | | } else if (no.startsWith(ninput)) { |
| | | return false; |
| | |
| | | return true; |
| | | } else { |
| | | // Try again... |
| | | app.println(); |
| | | app.printMessage(errMsg); |
| | | } |
| | | |
| | |
| | | * The verbose message. |
| | | */ |
| | | public final void printVerboseMessage(String msg) { |
| | | if (isVerbose()) { |
| | | if (isVerbose() || isInteractive()) { |
| | | err.println(wrapText(msg, MAX_LINE_WIDTH)); |
| | | } |
| | | } |
| | |
| | | printMessage(prompt); |
| | | println(); |
| | | builder.print(printer); |
| | | println(); |
| | | |
| | | return null; |
| | | } else { |
| | |
| | | app.println(); |
| | | String errMsg = getMessage(MSGID_DSCFG_ERROR_GENERAL_CHOICE, size); |
| | | app.printMessage(errMsg); |
| | | app.println(); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | } catch (IllegalManagedObjectNameException e) { |
| | | ArgumentException ae = ArgumentExceptionFactory |
| | | .adaptIllegalManagedObjectNameException(e, d); |
| | | app.println(); |
| | | app.printMessage(ae.getMessage()); |
| | | return null; |
| | | } |
| | |
| | | // A child with the specified name must already exist. |
| | | int msgID = MSGID_DSCFG_ERROR_CREATE_NAME_ALREADY_EXISTS; |
| | | String msg = getMessage(msgID, relation.getUserFriendlyName(), input); |
| | | app.println(); |
| | | app.printMessage(msg); |
| | | return null; |
| | | } |
| | |
| | | } |
| | | default: { |
| | | // Display a menu. |
| | | Arrays.sort(children, String.CASE_INSENSITIVE_ORDER); |
| | | List<String> choices = Arrays.asList(children); |
| | | int msgID = MSGID_DSCFG_FINDER_PROMPT_MANY; |
| | | String msg = getMessage(msgID, d.getUserFriendlyName()); |