@Preference(name = "color") @Option(name = "C", longName = "color") protected void enableAnsiColors(final Boolean flag) { Ansi.setEnabled(flag); }
protected PreferenceDescriptor(final Preferences base, final Preference pref, final Setter setter) { // base could be null this.base = base; assert pref != null; this.spec = pref; assert setter != null; this.setter = setter; // Handle "" = null, since default values in annotations cannot be set to null if (pref.name() != null && pref.name().length() == 0) { this.name = null; } else { this.name = pref.name(); } this.system = pref.system(); // On IBM JDK, the value passed is null instead of the default value, so fix it in case this.type = pref.type() != null ? pref.type() : UNINITIALIZED_CLASS; // Handle "" = null, since default values in annotations cannot be set to null if (pref.path() != null && pref.path().length() == 0) { this.path = null; } else { this.path = pref.path(); } }
@Preference(name = "terminal") @Option(name = "T", longName = "terminal") protected void setTerminalType(final String type) { TerminalFactory.configure(type); }
@Preference(name = "quiet") @Option(name = "q", longName = "quiet") protected void setQuiet(final boolean flag) { if (flag) { setConsoleLogLevel(Level.ERROR); io.setVerbosity(IO.Verbosity.QUIET); } }
@Preference(name = "debug") @Option(name = "d", longName = "debug") protected void setDebug(final boolean flag) { if (flag) { setConsoleLogLevel(Level.DEBUG); io.setVerbosity(IO.Verbosity.NORMAL); showErrorTraces = true; } }
@Preference(name = "trace") @Option(name = "X", longName = "trace") protected void setTrace(final boolean flag) { if (flag) { setConsoleLogLevel(Level.TRACE); io.setVerbosity(IO.Verbosity.NORMAL); showErrorTraces = true; } }
@Preference @Option(name="c", longName="include-commands", optionalArg=true) private Boolean includeCommands = true; @Preference @Option(name="a", longName="include-aliases", optionalArg=true) private Boolean includeAliases = true; @Preference @Option(name="g", longName="include-groups", optionalArg=true) private Boolean includeGroups = true; @Preference @Option(name="m", longName="include-meta", optionalArg=true) private Boolean includeMeta = true; @Preference @Option(name="A", longName="include-all", optionalArg=true) private Boolean includeAll;
@Preference @Argument() private List<Section> sections;
protected boolean version; @Preference @Option(name = "e", longName = "errors") protected boolean showErrorTraces = false;