Dash "-" is not allowed in the short option string. Replace it
with 'K', a single character option consistent with others.
Having two options to control warnings on the unkeyed list,
although mutually exclusive, makes the default behavior unclear
when neither option is used.
Simplify the options by removing 'warning-for-unkeyed-lists'
while preserving the original default behavior of warning against
unkeyed lists when neither option is used.
JIRA: YANGTOOLS-1429
Change-Id: I6c37892ae7e39864420a0e6c15dd2fc1cf0ba952
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
* -v, --verbose shows details about the results of test running.
* -o, --output path to output file for logs. Output file will be overwritten.
* -m, --module-name validate yang by module name.
* -v, --verbose shows details about the results of test running.
* -o, --output path to output file for logs. Output file will be overwritten.
* -m, --module-name validate yang by module name.
- * -wul, --warning-for-unkeyed-lists
- * add warnings about unkeyed lists with config true.
+ * -K, --no-warning-for-unkeyed-lists
+ * do not add warnings about unkeyed lists with config true.
*/
@SuppressWarnings({"checkstyle:LoggerMustBeSlf4j", "checkstyle:LoggerFactoryClassParameter"})
public final class Main {
*/
@SuppressWarnings({"checkstyle:LoggerMustBeSlf4j", "checkstyle:LoggerFactoryClassParameter"})
public final class Main {
private static final Option QUIET = new Option("q", "quiet", false, "completely suppress output.");
private static final Option VERBOSE = new Option("v", "verbose", false,
"shows details about the results of test running.");
private static final Option QUIET = new Option("q", "quiet", false, "completely suppress output.");
private static final Option VERBOSE = new Option("v", "verbose", false,
"shows details about the results of test running.");
- private static final Option LIST_WARNING_ON = new Option("wul", "warning-for-unkeyed-lists", false,
- "add warnings about unkeyed lists with config true");
- private static final Option LIST_WARNING_OFF = new Option("no-wul", "no-warning-for-unkeyed-lists", false,
+ private static final Option LIST_WARNING_OFF = new Option("K", "no-warning-for-unkeyed-lists", false,
"do not add warnings about unkeyed lists with config true");
private Main() {
"do not add warnings about unkeyed lists with config true");
private Main() {
.addOption(PATH)
.addOption(RECURSIVE)
.addOptionGroup(new OptionGroup().addOption(DEBUG).addOption(QUIET).addOption(VERBOSE))
.addOption(PATH)
.addOption(RECURSIVE)
.addOptionGroup(new OptionGroup().addOption(DEBUG).addOption(QUIET).addOption(VERBOSE))
- .addOptionGroup(new OptionGroup().addOption(LIST_WARNING_ON).addOption(LIST_WARNING_OFF))
+ .addOption(LIST_WARNING_OFF)
.addOption(OUTPUT)
.addOption(MODULE_NAME)
.addOption(FEATURE);
.addOption(OUTPUT)
.addOption(MODULE_NAME)
.addOption(FEATURE);
LOG_ROOT.detachAndStopAllAppenders();
}
LOG_ROOT.detachAndStopAllAppenders();
}
- final boolean warnForUnkeyedLists;
- if (arguments.hasOption(LIST_WARNING_ON.getLongOpt()) || !arguments.hasOption(LIST_WARNING_OFF.getLongOpt())) {
- warnForUnkeyedLists = true;
- } else {
- warnForUnkeyedLists = false;
- }
+ final boolean warnForUnkeyedLists = !arguments.hasOption(LIST_WARNING_OFF.getLongOpt());
final List<String> yangLibDirs = initYangDirsPath(arguments);
final List<String> yangFiles = new ArrayList<>();
final List<String> yangLibDirs = initYangDirsPath(arguments);
final List<String> yangFiles = new ArrayList<>();