malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.24k stars 31 forks source link

Command Block How-To #58

Open Jmos opened 4 years ago

Jmos commented 4 years ago

How to script IF THEN [ ELSE [ENDIF]] ( ) not implemented ?

Jmos commented 4 years ago

How to script IF condition THEN commands [ ELSE commands [ENDIF]] ( ) command block not implemented ?

malxau commented 4 years ago

Firstly, sorry for the delay in replying.

When writing Yori I didn't prioritize scripting features, since it seemed to me like Powershell is a more capable scripting environment, and CMD is more ubiquitous. I haven't implemented the ( ) block logic. Looking at how CMD did this, it will require major changes to the parser to implement, in order to be able to evaluate things like (foo1 && foo2 && foo3) || bar . The if command needs to be able to understand not just argc/argv arguments, but a more structured form of data so that it can know what to execute. I don't think I can do these changes in 1.3 without introducing far too many bugs.

Nonetheless, I'll keep this in mind for a future release. I'd wanted to move a lot of this logic around anyway so ymake can use it, and knowing that it needs to be more capable and if needs to use it as well is good to know.

Jmos commented 4 years ago

thanx a lot