Skip to content
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

rename the parse() method and adjust documentation #979

Closed
wants to merge 2 commits into from
Closed

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Jan 11, 2024

Based on discussions in #974

@phlptp phlptp requested a review from henryiii January 11, 2024 20:14
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b6e367d) 99.07% compared to head (4586543) 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #979      +/-   ##
===========================================
+ Coverage   99.07%   100.00%   +0.92%     
===========================================
  Files          18        18              
  Lines        4550      4573      +23     
===========================================
+ Hits         4508      4573      +65     
+ Misses         42         0      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -196,7 +196,6 @@ this:
```cpp
int main(int argc, char** argv) {
CLI::App app{"App description"};
argv = app.ensure_utf8(argv);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? This is by far the best way to do this - parse() / parse_from_cli_args() does black magic on some operating systems, while this reliably works everywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this section of the documentation it is covering the most basic application, in a vast majority of applications this is not necessary. I can add it back if you think it valuable, but to me it creates a lot of potentially unnecessary questions when just getting started.

@@ -1460,7 +1457,11 @@ itself.
> int main() {
> CLI::App app;
> // ...
> CLI11_PARSE(app);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of CLI11_PARSE(one arg) was to make this simpler to type, encouraging people to support unicode. This makes this "short" but magical method four lines long instead! It would better to just use the more reliable and safe method then (argv = app.ensure_utf8(argv);), which is only one line longer.

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 31, 2024

Superseded by #987

@phlptp phlptp closed this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants