-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Bump clap version to 3.2 #706
Conversation
I think it is better to rewrite with the derive clap feature. |
Currently I don't have much experience with clap derive so this MR just try to bump and resolve all breaking changes, keeping current behavior. If the decision still is rewrite to derive, I hope we can continue as another issue I'll try to working on it. |
You can push changes with rewrite to derive in this branch. Code is built more maintainable with derive clap feature. |
I'll try update to use clap derive. Currently I'm not sure what to ask, so I will ping you if necessary but I think it will be around meaning of some flag or env variables because I'm not familiar with functionality of all flags. |
the changes in the files |
in
You probably don't see that because clap version 2.34 is necessary for sea-schema |
in for subcommand in get_subcommands() {
migrate_subcommands =
migrate_subcommands.subcommand(subcommand.arg(arg_migration_dir.clone()));
}
command.rs from clap 3#[inline]
#[must_use]
pub fn subcommand<S: Into<App<'help>>>(mut self, subcmd: S) -> Self {
self.subcommands.push(subcmd.into());
self
} You probably don't see that because clap version 2.34 is necessary for sea-schema |
@cindRoberta thanks for pointing out, I missed the change in sea-schema. I'll update more code with derive feature too. |
@ikrivosheev I just update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smonv thank you for contribution! Some comments
sea-orm-migration: bump clap version to 3.1.17 sea-orm-cli: use clap derive API instead of builder API sea-orm-migration: use clap derive
@smonv tests are passed. Can we review your PR or do you have some Todo? |
Yes, please help me review this. Sorry I update on last weekend so I forgot to request review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @smonv, sorry for the delay. All in all, it looks good!
I found an issue with the updated migration CLI:
sea-orm/examples/tonic_example/migration on pr/706 [$!] is 📦 v0.1.0 via 𝗥 v1.61.0 via 🅒 base
➜ DATABASE_URL="postgres://root:root@localhost/active_enum_tests" cargo r -- up -v
Finished dev [unoptimized + debuginfo] target(s) in 0.20s
Running `/Applications/MAMP/htdocs/sea-orm/examples/tonic_example/target/debug/migration up -v`
error: The argument '--verbose <VERBOSE>' requires a value but none was supplied
USAGE:
migration up [OPTIONS]
For more information try --help
I updated the code and fixed some clippy warnings, feel free to review and cherrypick it onto this PR:
I changed the Option<bool>
to bool
for the verbose
field. Just like what you did to the sea-orm-cli
.
@billy1624 thanks for the help. I just cherry pick all your commit to this PR. Please help review it again. |
I just push changes needed to bump clap to 3.2 |
@billy1624 looks good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyt2y3 @billy1624 thank for helping me. Happy to help! |
Thank you all |
PR Info
Changes