You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Claudenw (via GitHub)" <gi...@apache.org> on 2024/05/11 14:37:32 UTC

[PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Claudenw opened a new pull request, #271:
URL: https://github.com/apache/commons-cli/pull/271

   Fix for CLI-332.
   
   Added a `BiFunction<String, Object, String>` to the HelpFormatter and its Builder.    Also tests for same.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #271:
URL: https://github.com/apache/commons-cli/pull/271#discussion_r1597480040


##########
src/main/java/org/apache/commons/cli/HelpFormatter.java:
##########
@@ -121,6 +121,7 @@ public Builder setShowDeprecated(final boolean useDefaultFormat) {
          *
          * @param showDeprecatedFunc Specify the format for the deprecated options.
          * @return this.
+         * @since(1.8.0)

Review Comment:
   There are no parens in Javadoc tags, it's not a function call ;-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #271:
URL: https://github.com/apache/commons-cli/pull/271#discussion_r1597482434


##########
src/main/java/org/apache/commons/cli/HelpFormatter.java:
##########
@@ -121,6 +121,7 @@ public Builder setShowDeprecated(final boolean useDefaultFormat) {
          *
          * @param showDeprecatedFunc Specify the format for the deprecated options.
          * @return this.
+         * @since(1.8.0)

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #271:
URL: https://github.com/apache/commons-cli/pull/271#discussion_r1597465949


##########
src/main/java/org/apache/commons/cli/HelpFormatter.java:
##########
@@ -103,14 +109,23 @@ public Builder setPrintWriter(final PrintWriter printWriter) {
         /**
          * Sets whether to show deprecated options.
          *
-         * @param showDeprecated Whether to show deprecated options.
+         * @param useDefaultFormat if {@code true} use the default format, otherwise clear the formatter.
          * @return this.
          */
-        public Builder setShowDeprecated(final boolean showDeprecated) {
-            this.showDeprecated = showDeprecated;
-            return this;
+        public Builder setShowDeprecated(final boolean useDefaultFormat) {
+            return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT : null);
         }
 
+        /**
+         * Sets whether to show deprecated options.
+         *
+         * @param showDeprecatedFunc Specify the format for the deprecated options.
+         * @return this.
+         */
+        public Builder setShowDeprecated(final BiFunction<String, Option, String> showDeprecatedFunc) {

Review Comment:
   A new public or protected API needs a `@since` tag, which for to semantic versioning would be `1.8.0`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-332] Add optional HelpFormatter Function to document Deprecated options [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #271:
URL: https://github.com/apache/commons-cli/pull/271


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #271:
URL: https://github.com/apache/commons-cli/pull/271#discussion_r1597465949


##########
src/main/java/org/apache/commons/cli/HelpFormatter.java:
##########
@@ -103,14 +109,23 @@ public Builder setPrintWriter(final PrintWriter printWriter) {
         /**
          * Sets whether to show deprecated options.
          *
-         * @param showDeprecated Whether to show deprecated options.
+         * @param useDefaultFormat if {@code true} use the default format, otherwise clear the formatter.
          * @return this.
          */
-        public Builder setShowDeprecated(final boolean showDeprecated) {
-            this.showDeprecated = showDeprecated;
-            return this;
+        public Builder setShowDeprecated(final boolean useDefaultFormat) {
+            return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT : null);
         }
 
+        /**
+         * Sets whether to show deprecated options.
+         *
+         * @param showDeprecatedFunc Specify the format for the deprecated options.
+         * @return this.
+         */
+        public Builder setShowDeprecated(final BiFunction<String, Option, String> showDeprecatedFunc) {

Review Comment:
   A new public or protected API needs a `@since` tag, which for semantic versioning would be `1.8.0`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CLI-332: added ability to display deprecation information in help output [commons-cli]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #271:
URL: https://github.com/apache/commons-cli/pull/271#issuecomment-2105889090

   ## [Codecov](https://app.codecov.io/gh/apache/commons-cli/pull/271?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 95.83%. Comparing base [(`9f6b23b`)](https://app.codecov.io/gh/apache/commons-cli/commit/9f6b23b04d88fef2eaa67607753f3fc82375c52e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`a955ec3`)](https://app.codecov.io/gh/apache/commons-cli/pull/271?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 180 commits behind head on master.
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #271      +/-   ##
   ============================================
   + Coverage     91.90%   95.83%   +3.92%     
   - Complexity      575      658      +83     
   ============================================
     Files            22       23       +1     
     Lines          1247     1367     +120     
     Branches        210      226      +16     
   ============================================
   + Hits           1146     1310     +164     
   + Misses           63       25      -38     
   + Partials         38       32       -6     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/commons-cli/pull/271?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org