Closed wryun closed 2 years ago
I think I've got it working. The most problematic part was understanding how redirection was represented in the tree and fixing it after rewriting the simple
production broke redirection. I couldn't find a way around such a modification unfortunately. The tokenizer had to be modified slightly to insert carets, else foo = a=b
would result in foo
having 3 args; foo = a^=^b
is how it will appear when using es -x
.
memreflect/es-shell@45628a4b
Awesome! Tricky, but not too many changes at least. Would you like to raise a PR?
My main frustration with using es as an interactive shell is having to handle GNU style long arguments, as '=' is part of es syntax wherever it occurs in a line. i.e.
will generate a syntax error. You can get around this with quotes or escapes:
But it's annoying, and means you can't copy/paste examples designed for other shells.
xs addressed this by replacing '=' with ':=', which is a good solution but drops backwards compatibilty and similarity with other shells.
I'm wondering if there's an easy way to make both uses of '=' work, since a normal usage of a long argument reliably results in a syntax error (as the LHS isn't valid).