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
Request: Allow --output-file multiple times, only use right-most #3248
Comments
I think I'd find this behavior really confusing. What if we provided a |
A file-based configuration or global configuration would not work for my case, which is functions that have their own defaults but are separate from any other ways the user wishes to use pip or uv. With FWIW, this is a very common convention (later options "win"), and is used not just by pip-tools but also pip itself. For example, the following command only uses the $ pip install --cache-dir="$PWD/cache1" requests --cache-dir="$PWD/cache2" |
I think you'd just write a simple bash function instead of an alias that sets a default value for the variable before calling into
I think with something like |
FWIW here's maybe a more analogous option from pip: $ pip install --dry-run --quiet --report=out1.json requests --report=out2.json As expected, only |
Similarly, both busybox |
I'll note that I am having similar troubles with e.g. |
I suspect part of this comes from argparse's design. Many python libraries use argparse/similar library. argparse's default behavior is last one wins with no awareness of meaning flag. edit: Personally I like current duplicates are hard error over last one wins. My guess is it's commonness in python ecosystem is less that clis made choice individually, but argument handling libraries default choices made it common. |
Is this the same? clap-rs/clap#4261 |
Yeah, looks like exactly that. |
I think you can set this globally with something like https://docs.rs/clap/latest/clap/struct.Command.html#method.args_override_self. |
requirements.in
:I'm requesting that instead, the above command write output to (only)
reqs2.txt
, the latest instance of-o
/--output-file
on the command line. This is useful when using shell aliases or functions to wrapuv
, when you specify a "default" output file in the alias or function, while allowing any invocation to easily override that default by specifying the option again, on the command line.That's how pip-tools behaves, and I make use of that behavior.
The text was updated successfully, but these errors were encountered: