Instead of breaking, can you just ignore unknown options?
I could do, but I don’t want to do this by default.
There’s already an environment variable, EXA_STRICT, that makes exa complain when you pass in an argument twice. Maybe this variable could be extended (such as setting EXA_STRICT=0 or EXA_STRICT=lax) so it doesn’t complain on unknown arguments.
Yup, up to you. I just didn't think an unknown argument should fail execution..
Yes please... -A breaking exa ruined my company's bootstrap scrips
Personally, I would hate to see this as a default behaviour - and would strongly discourage its use in scripting. The big problem is that it can cause scripts to fail in other ways if a flag passed are ignored but the behaviour of the command is not changed - quite often these problems can be silent or hard to find and thus would rather things fail loudly and quickly when they encounter something they do not expect.
Far too often I have encountered commands that will happily execute _the wrong thing_ as they happen to ignore or don't support (or I happen to have a typo in) the arguments I pass to them for whatever reason. Erroring eairly and by default is the best option to prevent this.
An environment var to override this behaviour could be a solution - but a far better one is to support all the flags that ls does and adjust the behaviour of the application accordingly (possibly ignoring or aliasing them to other options _where appropriate_). But this really depends on if exa is trying to be a fully compatible drop-in replacement for ls or if you should encourage the use of ls in existing scripts.
I don't agree with ignoring the options. Leaving out useful messages why the program isn't behaving like you expect will cost some few hours of wondering about why your arguments are not correctly parsed.
Maybe alias -A for -a because
exa -a == ls -A
exa -a != ls -a
I do like that exa is ignoring . and .. by default.
alias ls="exa" Would be so lovely with my current scripts.
alias ls="exa EXA_STRICT=lax" not so much :smile:
Most helpful comment
I don't agree with ignoring the options. Leaving out useful messages why the program isn't behaving like you expect will cost some few hours of wondering about why your arguments are not correctly parsed.
Maybe alias
-Afor-abecauseexa -a==ls -Aexa -a!=ls -aI do like that
exais ignoring.and..by default.alias ls="exa"Would be so lovely with my current scripts.alias ls="exa EXA_STRICT=lax"not so much :smile: