-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plan for 2.0 #384
Comments
|
So that we can get something out rather than keep waiting for a large change, I'd like to postpone the pre-compile plans (which is mostly not user facing; that is, users don't have to use it) for 2.x. That way I can focus on the exception part (which will be user-facing), and get a release out sooner rather than (much) later. I have a daughter coming soon, so trying to plan out my limited time! |
I might be forced to put off the exception refactoring, since that will further delay 2.0 and as I always tell other people, numbers are cheap - we could do a 3.0 if it requires a backwards incompatible change. And 2.0 would already be useful to get out the door. (plus I accidentally deleted some work I had done on it) I'll try to get the final removals in (#597 and dropping add_complex) and currently open fixes in, and then if I can't get the error reworking in within a week or so, I'll probably just make a release. @phlptp is this fine with you, or do you have anything else that needs to go in? // Only part of work that didn't get deleted, pasting here
#ifndef CLI11_EXCEPTIONS
#ifdef __EXCEPTIONS
#define CLI11_EXCEPTIONS 1
// GCC and Clang will define the above define
#elif __GNUC__
#define CLI11_EXCEPTIONS 0
#else
#define CLI11_EXCEPTIONS 1
#endif
#endif |
Nothing major, that can’t wait. If I fix some of the issues in the next week I will make a PR but don’t wait on me for a release.
From: Henry Schreiner ***@***.***>
Sent: Tuesday, June 15, 2021 9:30 AM
To: CLIUtils/CLI11 ***@***.***>
Cc: Top, Philip L. ***@***.***>; Mention ***@***.***>
Subject: Re: [CLIUtils/CLI11] Plan for 2.0 (#384)
I might be forced to put off the exception refactoring, since that will further delay 2.0 and as I always tell other people, numbers are cheap - we could do a 3.0 if it requires a backwards incompatible change. And 2.0 would already be useful to get out the door. (plus I accidentally deleted some work I had done on it)
I'll try to get the final removals in (#597<https://urldefense.us/v3/__https:/github.com/CLIUtils/CLI11/pull/597__;!!G2kpM7uM-TzIFchu!gxMiH-ZDEp6QyIMpHJp77gefSAmCg2CyymCb9yKa9pvDkQ1Zm5lNT4rXQUvq0iM$> and dropping add_complex) and currently open fixes in, and then if I can't get the error reworking in within a week or so, I'll probably just make a release. @phlptp<https://urldefense.us/v3/__https:/github.com/phlptp__;!!G2kpM7uM-TzIFchu!gxMiH-ZDEp6QyIMpHJp77gefSAmCg2CyymCb9yKa9pvDkQ1Zm5lNT4rXhJIs7j4$> is this fine with you, or do you have anything else that needs to go in?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https:/github.com/CLIUtils/CLI11/issues/384*issuecomment-861649665__;Iw!!G2kpM7uM-TzIFchu!gxMiH-ZDEp6QyIMpHJp77gefSAmCg2CyymCb9yKa9pvDkQ1Zm5lNT4rXc9Phj04$>, or unsubscribe<https://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AE5VWELUF7CSLKNGNVUSYR3TS55ZVANCNFSM4KBWSBYQ__;!!G2kpM7uM-TzIFchu!gxMiH-ZDEp6QyIMpHJp77gefSAmCg2CyymCb9yKa9pvDkQ1Zm5lNT4rX7ZU-_qE$>.
|
It would be nice to add a regex validator. |
Release should happen fairly soon, probably end of this week. Will need to update contributors, changelog, upcoming -> new features labels. |
That would require GCC 4.9+. It's easy to add one yourself, though - and maybe it could be added as an optional include. Those are a bit easier in 2.0. |
I think a number of the validators should be split into a separate optional include. Then we would have a little more freedom for a validator library that wouldn't slow down compilation if someone didn't need them. At that point adding a regex validator shouldn't be an issue either. But lets get the 2.0 release out first. |
@henryiii are you changing the minimum compiler requirement on 2.0? |
No, it't still 4.8+. CentOS 7 is still an important target (and manylinux1 is 4.8 too). But I'd be okay with an optional file having a higher requirement. |
This is now out! |
Just to confirm here @henryiii, the exception refactoring didn't happen, right? Is it still planned? |
Yes, it was put off to avoid delaying 2.0 too much. |
_This is the new PR I've mentioned to work on in PR #858_ ## A better Help Formatter _See below for images of the new help page_ Finally, after a lot of planning, understanding CLI11's codebase, testing and coding, the new default Help Formatter is done. There are a lot of changes to make the help page more readable and closer to UNIX standards, see Changelog below for details. One of the highlights is automatic paragraph formatting with correct line wrapping for App and options/flag descriptions as well as the footer. A goal was to provide more flexibility and better readability for the help page while providing full compatibility with Apps using CLI11 (no breaking changes and no changes to Apps required). Also better support for different terminal sizes. Users can now specify three new optional attributes: `right_column_width_`, `description_paragraph_width_` and `footer_paragraph_width_`. See code documentation for more details. The different columns for options/flags now scale with the set `column_width_` value: Single dash flags occupy 33% of the set `column_width_`, double dash flags and options (like REQUIRED) 66%. These new attributes allow for indirectly respecting terminal geometry, footer paragraph formatting has also been added (#355). This PR also implements the issues #353 and #856. The new help page formatting can also be used as an input for man page generation, since it's oriented on the man page style (#413). [help2man](https://www.gnu.org/software/help2man/) can be used to generate man pages from help output (see comment down below for example). I thoroughly tested this code with all possible combinations of flags, options, positionals, subcommands, validators, ... So far everything works great. I hope this PR looks good and meets all requirements. I'm looking forward to the implementation of this PR into CLI11. If you have any questions or suggestions feel free to comment. ### Fixed/implemented issues by this PR - #353 Better options formatting - #856 Space between options - #355 Footer formatting - #413 Man page generation can be achieved using help2man with the new help formatting - #384 (comment) Better help formatting can be marked as complete ### What about the failing tests? Of course the tests expect the old help text format. This is why 6 of the tests are failing. Since it is a bit of work to migrate the tests to the new help format, I first wanted to push out this PR and get confirmation before I'll update all the tests. So please let me know if this PR gets implemented, what changes should be made and then I'll migrate the tests to the new help format, either in this PR or I'll make a new one. ## Changelog: #### There are _no breaking changes_. Every App using CLI11 will work with this new formatter with no changes required. - Added empty lines at beginning and end of help text - Removed double new-line between option groups for consistency. Now all sections have the same number of new-lines - Switched usage and description order - Only show "Usage"-string if no App name is present. This provides better readability - Made categories (Options, Positionals, ...) capital - Changed `ConfigBase::to_config` to correctly process capital "OPTIONS"-group (only affects descriptions of the config file, not a breaking change) - Added a paragraph formatter function `streamOutAsParagraph` to StringTools.hpp - Made "description" a paragraph block with correct, word respecting line wrapping and indentation (using the new paragraph formatter function) - Made the footer a paragraph block with correct, word respecting line wrapping and indentation - Updated documentation for `column_width_` to make it more clear - Added new member: `right_column_width_`, added getter and setter for `right_column_width_` - Added new member: `description_paragraph_width_`, added getter and setter for `description_paragraph_width_` - Added new member: `footer_paragraph_width_`, added getter and setter for `footer_paragraph_width_ ` - Positionals description are now formatted as paragraph with correct, word respecting line wrapping - Options description are now formatted as paragraph with correct, word respecting line wrapping - Short and long options/flags/names are now correctly formatted to always be at the right position (also for subcommand options/flags) - Short and long options/flags/names column widths scale linearly with the `column_width_` attribute to better adapt to different `column_width_` sizes - Merged PR #860 ## What's planned for the future? - I'm thinking of better formatting the options of flags (like REQUIRED, TEXT, INT, ...) and make them also in a seperate column. This way they would also always be at the same position. However I decided against it for this PR, since I wanted them to be as close as possible to the actual flag. With my implementation it is quite easy to add this change in the future. - Subcommands: I'm planning on better formatting the Subcommands. With this PR only the short and long flags/options of subcommands are better formatted (like it is with the main flags, see images down below). - Maybe implement a different way to display expected data type options (TEXT, INT, ...). For example: `--file-name=<TEXT>` for long flags only and if `disable_flag_override_` is false. - Maybe add something like this: #554 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Philip Top <[email protected]>
add_set
templated methodsadd_option
refactor!: drop defaulted from add_option #597The text was updated successfully, but these errors were encountered: