Conversation
This caused major annoyances with e.g. `find -exec`, and it's utterly
useless - "{}" expands to nothing, so why have it at all?
Fixes fish-shell#1109.
This was highly surprising. Fixes fish-shell#3002.
I've misplaced an empty line, sorry!
|
Note: The |
|
That is awesome, thanks for tackling this! I agree the alternating comma behavior is weird, I'm presuming Any chance you could implement #3802 while you're at it? |
Yes. Which is why I'm oblivious as to why the current behavior was a thing in the first place, and why this is rather unlikely to cause any issues in practice.
No. That would require touching the parser/tokenizer (since expand.cpp receives |
Description
This is a double-whammy to remove some of the annoyances from brace/bracket-expansion (the code calls it "brackets", I've only ever heard "braces" elsewhere).
It changes a literal
{}to expand to itself, which fixes issue #1109, and makesfind -execnicer to use.It also changes it so successive commas in braces are seen as successive empty items, rather than alternating between an empty item and a literal ",". So
x{,,,}yis no longer seen asxy x,y xy(because the second "," is seen as a literal "," rather than a separator), but as "xy xy xy xy". That fixes #3002. (To get the literal comma, it can be\\escaped or quoted still)Both of these are in the "theoretically backwards-incompatible, but unlikely to break stuff" category. The former especially will only break code that does useless stuff - currently a
{}could be removed everywhere without any changes, so why have it at all?TODOs: