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

Port mdBook to clap3 #1731

Merged
merged 9 commits into from
Mar 28, 2022
Merged

Port mdBook to clap3 #1731

merged 9 commits into from
Mar 28, 2022

Conversation

epage
Copy link
Contributor

@epage epage commented Jan 19, 2022

This includes resolving the deprecation warnings, one warning per commit. This was a fairly straightforward conversion, sticking to simpler parts of clap. App::arg_from_usage was probably the most involved. The replacement, arg!(), doesn't seem to support kebab-case in value names.

I tested by

  • Adding the App::debug_assert() test
  • Inspecting before/after of --help for each subcommand

I'm assuming there is some end-to-end tests to at least catch egregious cases.

Differences I noticed (all cosmetic)

  • Colored help is now on all subcommands (ColoredHelp was set only on the parent before rather than with global_setting, now its the default)
  • Combining of the Flags and Options sections (UnifiedHelpMessage is now the only behavior)
  • Some spacing is slightly different so more lines of text wrap.

@epage
Copy link
Contributor Author

epage commented Jan 19, 2022

mdBook's MSRV is at 1.46.0. clap is at 1.54. We are open to experimenting with lowering the MSRV (clap-rs/clap#3267) though it isn't a priority for us.

Should we up mdBook's MSRV or hold off on this until either (1) clap's lowers or (2) mdBook is ready to bump?

@ehuss
Copy link
Contributor

ehuss commented Mar 27, 2022

I think we can probably bump the MSRV. We don't have a fixed policy, but I think 8 months is probably ok. Does 3.1.6 still work on 1.54?

@ehuss
Copy link
Contributor

ehuss commented Mar 27, 2022

Can this also update

mdBook currently requires at least Rust version 1.46.
?

@ehuss
Copy link
Contributor

ehuss commented Mar 27, 2022

Oh, and maybe add a comment in main.yml to keep them in sync (that was added in #1719, but that PR seemed to have stall).

@epage
Copy link
Contributor Author

epage commented Mar 28, 2022

Updated this with the MSRV bump with the comment linking the locations.

And yes, clap is still on 1.54. We had a request to extend our MSRV to a 6 month period. We are doing this on a trial basis

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss merged commit 7c37dd5 into rust-lang:master Mar 28, 2022
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.

None yet

2 participants