Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
91 stars 13 forks source link

Upgrade clap #50

Closed jayvdb closed 1 year ago

jayvdb commented 1 year ago

Just noting that clap should be upgraded. The UX for clap 4 is a lot better - e.g. little things like error messages are more helpful. I didnt do that as part of https://github.com/Electron100/butane/pull/23 as it would require a bit of effort.

e.g. just bumping to 4.1 results in

error[E0433]: failed to resolve: could not find `App` in `clap`
  --> butane_cli/src/main.rs:16:21
   |
16 |     let app = clap::App::new("butane")
   |                     ^^^ could not find `App` in `clap`

error[E0433]: failed to resolve: could not find `SubCommand` in `clap`
  --> butane_cli/src/main.rs:22:19
   |
22 |             clap::SubCommand::with_name("init")
   |                   ^^^^^^^^^^
   |                   |
   |                   could not find `SubCommand` in `clap`
   |                   help: a trait with a similar name exists (notice the capitalization): `Subcommand`

...

Also worth checking whether this project wants to keep using the "builder" pattern, or the newer "derive" approach that is more common with clap 4.

jayvdb commented 1 year ago

Note that using clap = { version = "3.2", features = ["deprecated"] } provides a lot of useful tips on upgrading to clap 4.