Skip to content

Commit

Permalink
Revert "[remkop#1422] Un-deprecate the @Option help attribute"
Browse files Browse the repository at this point in the history
This reverts commit b6e2e97.
  • Loading branch information
MarkoMackic committed Oct 17, 2021
1 parent c9782c9 commit 326c04e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
1 change: 0 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Picocli follows [semantic versioning](http://semver.org/).


## <a name="4.6.2-fixes"></a> Fixed issues
* [#1422] API: Un-deprecate the `@Option` `help` attribute; it is useful for custom help options. Thanks to [kaushalkumar](https://github.com/kaushalkumar) for raising this.
* [#1337][#1338] Enhancement: prevent spurious `WARNING: tag not found in include file` messages when generating man pages. Thanks to [Philip Crotwell](https://github.com/crotwell) for the pull request.
* [#1340] Enhancement: add xref to generated man page document to link to subcommands from the parent command page. Thanks to [Philip Crotwell](https://github.com/crotwell) for the pull request.
* [#1351][#1362] Enhancement: avoid calling option `completionCandidates` when displaying usage help if `${COMPLETION-CANDIDATES}` is not specified in description. Thanks to [Wenhao ZHANG](https://github.com/wtd2), [sustc11810424](https://github.com/sustc11810424) and [Yining Tang](https://github.com/Lanninger08) for the pull request.
Expand Down
33 changes: 11 additions & 22 deletions src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -3656,33 +3656,22 @@ public enum ScopeType {
boolean required() default false;

/**
* <p>This should rarely be used: the recommended attributes are {@link #usageHelp() usageHelp} and {@link #versionHelp() versionHelp}.
* </p><p>
* Only set {@code help=true} when this option should disable validation of the remaining
* arguments, and no error message should be generated for missing required options.
* </p><p>
* This is useful for custom help options that are in addition to the standard help and
* version options. For example if your application has many hidden options or
* subcommands, and there is a custom help option like {@code --detailed-help} that prints
* the usage help message for these hidden options and subcommands.
* Set {@code help=true} if this option should disable validation of the remaining arguments:
* If the {@code help} option is specified, no error message is generated for missing required options.
* <p>
* This attribute is useful for special options like help ({@code -h} and {@code --help} on unix,
* {@code -?} and {@code -Help} on Windows) or version ({@code -V} and {@code --version} on unix,
* {@code -Version} on Windows).
* </p>
* <p><b>Note:</b></p>
* <p>
* Use the {@link #usageHelp() usageHelp} for "normal" help options (like {@code -h} and {@code --help} on unix,
* {@code -?} and {@code -Help} on Windows)
* and use {@link #versionHelp() versionHelp} for "normal" version help ({@code -V} and {@code --version} on unix,
* {@code -Version} on Windows):
* picocli has built-in logic so that options with {@code usageHelp=true} or {@code versionHelp=true}
* will automatically cause the requested help message to be printed in applications
* that use the {@link #execute(String...)} method, without any code in the application.
* </p><p>
* Note that there is no such automatic help printing for options with {@code help=true};
* applications need to check whether the end user specified this option and take appropriate action
* in the business logic of the application.
* Note that the {@link #parse(String...)} method will not print help documentation. It will only set
* the value of the annotated field. It is the responsibility of the caller to inspect the annotated fields
* and take the appropriate action.
* </p>
* @return whether this option disables validation of the other arguments
* @deprecated Use {@link #usageHelp()} and {@link #versionHelp()} instead. See {@link #printHelpIfRequested(List, PrintStream, CommandLine.Help.Ansi)}
*/
boolean help() default false;
@Deprecated boolean help() default false;

/**
* Set {@code usageHelp=true} for the {@code --help} option that triggers display of the usage help message.
Expand Down

0 comments on commit 326c04e

Please sign in to comment.