| | |
| | | } |
| | | |
| | | /** |
| | | * The value for the long option advanced. |
| | | */ |
| | | private static final String OPTION_DSCFG_LONG_ADVANCED = "advanced"; |
| | | |
| | | /** |
| | | * The value for the long option property. |
| | | */ |
| | | private static final String OPTION_DSCFG_LONG_PROPERTY = "property"; |
| | |
| | | private static final String OPTION_DSCFG_LONG_UNIT_TIME = "unit-time"; |
| | | |
| | | /** |
| | | * The value for the short option advanced. |
| | | */ |
| | | private static final Character OPTION_DSCFG_SHORT_ADVANCED = null; |
| | | |
| | | /** |
| | | * The value for the short option property. |
| | | */ |
| | | private static final Character OPTION_DSCFG_SHORT_PROPERTY = null; |
| | |
| | | */ |
| | | private static final char OPTION_DSCFG_SHORT_UNIT_TIME = 'M'; |
| | | |
| | | // The argument which should be used to request advanced mode. |
| | | private BooleanArgument advancedModeArgument; |
| | | |
| | | // The argument which should be used to specify zero or more |
| | | // property names. |
| | | private StringArgument propertyArgument; |
| | |
| | | |
| | | |
| | | /** |
| | | * Determines whether the user requested advanced mode. |
| | | * |
| | | * @return Returns <code>true</code> if the user requested |
| | | * advanced mode. |
| | | */ |
| | | protected final boolean isAdvancedMode() { |
| | | if (advancedModeArgument != null) { |
| | | return advancedModeArgument.isPresent(); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Determines whether the user requested record-mode. |
| | | * |
| | | * @return Returns <code>true</code> if the user requested |
| | |
| | | |
| | | |
| | | /** |
| | | * Registers the advanced mode argument with the sub-command. |
| | | * |
| | | * @param subCommand |
| | | * The sub-command. |
| | | * @param descriptionID |
| | | * The usage description message ID to be used for the |
| | | * argument. |
| | | * @param args |
| | | * The arguments for the usage description. |
| | | * @throws ArgumentException |
| | | * If the advanced mode argument could not be registered. |
| | | */ |
| | | protected final void registerAdvancedModeArgument(SubCommand subCommand, |
| | | int descriptionID, String... args) throws ArgumentException { |
| | | this.advancedModeArgument = new BooleanArgument(OPTION_DSCFG_LONG_ADVANCED, |
| | | OPTION_DSCFG_SHORT_ADVANCED, OPTION_DSCFG_LONG_ADVANCED, descriptionID, |
| | | (Object[]) args); |
| | | subCommand.addArgument(advancedModeArgument); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Registers the property name argument with the sub-command. |
| | | * |
| | | * @param subCommand |