argument parsing: accept some options only once, fixes #6026#6241
Conversation
7a0e740 to
c70788c
Compare
Codecov Report
@@ Coverage Diff @@
## master #6241 +/- ##
==========================================
- Coverage 83.26% 83.20% -0.06%
==========================================
Files 38 38
Lines 10385 10392 +7
Branches 2038 2041 +3
==========================================
Hits 8647 8647
- Misses 1232 1235 +3
- Partials 506 510 +4
Continue to review full report at Codecov.
|
|
I'll backport this today |
|
I woke up today with a fresh head and realized: this is a breaking change that we probably should not backport. It is worth considering why argparse defaults to silently ignoring all but the last instance of a given argument (a common pattern in CLI in general, not just python). People often write wrapper scripts or wrapper functions for the tools they use. Those wrappers pass some arguments to the underlying tool. The wrappers often allow pass-through of arbitrary arguments (e.g. This change breaks the above use case. It may be ok for borg 1.2 as a tradeoff between user confusion and advanced scripting, but 1.1 should avoid breaking code our users might rely on. @ThomasWaldmann, I will still backport this iff you say it is OK |
|
Hmm, guess that really could make problems. Can you move the above to a new ticket, please? Guess we first wait for some feedback and maybe backport later. |
No description provided.