You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which other syntaxes? I've not seen "-gte" anywhere, ever?
If this were actually much more understandable I'd be for it, but if you understand -gte you also understand -ge.
Also if e.g. you wanted to find all greater-or-equal comparisons you'd now have one more thing to grep for, it's one more thing to learn if you read someone's script, it's one more possible point of accidental incompatibility with old fish versions...
Those are fair points. I didn't mean compatible with other test implementations but rather with other abbreviations. ColdFusion-inspired things use it, such as conditional comments in HTML, and it's used a lot in data query languages.
Because I prefer in theory -gte over -ge and think the former is simply better, and because I've unsuccessfully tried stuff like [ $foo -gte 3 ] only to be disappointed, I'm inclined to agree with doing this. However I don't think it's a great idea to have two such similar ways of doing the same thing, particularly when incompatible with POSIX test, for little gain.
This seems like a great place for a fishy error message that teaches.
$ test 3 -gte 5
test: unexpected argument '-gte': Use '-ge' for a greater-than or equal comparison
In some more advanced universe, we might even prime autosuggestions with a version of the command line that would work (or rely on authoritative completions, which were removed long ago).
Reacted by David Adam, Tinu Weber, Jason Nader and Benedikt Vollmerhaus
Activity
faho commentedon Aug 25, 2019
Blergh.
A single letter difference to still have a cryptic abbreviation does not seem good to me.
mqudsi commentedon Aug 25, 2019
It's not so much to fix how cryptic it is so much as it is to make it compatible with other syntaxes.
faho commentedon Aug 25, 2019
Which other syntaxes? I've not seen "-gte" anywhere, ever?
If this were actually much more understandable I'd be for it, but if you understand
-gteyou also understand-ge.Also if e.g. you wanted to find all greater-or-equal comparisons you'd now have one more thing to grep for, it's one more thing to learn if you read someone's script, it's one more possible point of accidental incompatibility with old fish versions...
floam commentedon Aug 25, 2019
I've accidentally tried
test ... -gtebefore, but I'm not sure if that means there's a[out there that takes it.mqudsi commentedon Aug 25, 2019
Those are fair points. I didn't mean compatible with other
testimplementations but rather with other abbreviations. ColdFusion-inspired things use it, such as conditional comments in HTML, and it's used a lot in data query languages.floam commentedon Aug 25, 2019
Because I prefer in theory
-gteover-geand think the former is simply better, and because I've unsuccessfully tried stuff like[ $foo -gte 3 ]only to be disappointed, I'm inclined to agree with doing this. However I don't think it's a great idea to have two such similar ways of doing the same thing, particularly when incompatible with POSIXtest, for little gain.This seems like a great place for a fishy error message that teaches.
In some more advanced universe, we might even prime autosuggestions with a version of the command line that would work (or rely on authoritative completions, which were removed long ago).
faho commentedon Aug 26, 2019
That sounds completely okay to me.
faho commentedon Oct 31, 2019
Yeah let's go with a proper replacement for
test, like zanchey'sis(#6124), instead of putting lipstick on a pig.