-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make Command::args_overrides_self the default #4261
Copy link
Copy link
Open
Labels
A-parsingArea: Parser's logic and needs it changed somehow.Area: Parser's logic and needs it changed somehow.C-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsM-breaking-changeMeta: Implementing or merging this will introduce a breaking change.Meta: Implementing or merging this will introduce a breaking change.S-waiting-on-decisionStatus: Waiting on a go/no-go before implementingStatus: Waiting on a go/no-go before implementing
Metadata
Metadata
Assignees
Labels
A-parsingArea: Parser's logic and needs it changed somehow.Area: Parser's logic and needs it changed somehow.C-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsM-breaking-changeMeta: Implementing or merging this will introduce a breaking change.Meta: Implementing or merging this will introduce a breaking change.S-waiting-on-decisionStatus: Waiting on a go/no-go before implementingStatus: Waiting on a go/no-go before implementing
We had talked about swapping the default for 3.0 but punted.
When working on
ArgActionduring 3.2, I modeled it after Python'sargparsewhich only supports overriding, makingargs_overrides_selfthe only behavior for the new actions.When switching cargo to the new actions, some tests specifically checking for self-conflicts failed. This reminded me that in cargo 1.64.0,
--targetswitched from amultiple_occurrences(false)tomultiple_occurrences(true). This was a switch from an error case to a working case. Ifargs_overrides_selfhad been on, it would have been a switch from a working case to a working case, being a change in working behavior.We decided in 4.0.0 to defer a decision on the behavior and bring back
args_overrides_self, making the new actions behave like the old ones,So to summarize
args_overrides_self(true)alias ls='ls -xyz'would be safe to repeat some of those flagdSo should we switch to it being on by default, only on, or maintain status quo?
Notes
argparseargs_overrides_self(true)was setrm -fffff file).touch -d 'Jan 1 1970' -d 'Dec 31 2400' filewill use the latter timestamp.