-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixing passing --database-url as global cli arg #1201
Conversation
Does setting the |
The documentation of global states explicitly the current behavior, so this seems to be desired or at least not fixable without changing larger parts of clap.
|
There is also this issue on the clap repo, but setting this flag does not solve the problem… Edit: |
--database-url is passed as global cli argument, this means it may be not part of the current ArgMatches. To solve this we need to look recursivly in all current subcommands for the database-url
514f7f0
to
9d68c28
Compare
Can you add a few test cases? |
Something like the last commit? |
diesel_cli/tests/migration_run.rs
Outdated
|
||
#[test] | ||
fn migration_run_runs_pending_migrations_custom_database_url_1() { | ||
let p = project("migration_run").folder("migrations").build(); |
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.
Every test case needs to have a unique project name.
The last commit is the sort of thing I had in mind, yes. However, those tests pass without your code changes |
Based on some cursory testing, it looks like we should only need the |
Executing Also this function may fix the issue with |
I've modified those tests to run without the |
Can you add a note that we can remove that function once clap-rs/clap#978 is fixed? |
You need to run rustfmt |
* 2 Testcases for --migration_dir * Readd the tests from diesel-rs#1201 for --database_url
Fixed by #1304 |
--database-url is passed as global cli argument, this means it may be
not part of the current ArgMatches. To solve this we need to look recursivly in all current subcommands for the database-url