I was bored, so i was looking through my old nodes, and i decided to rework the CMD Flags into something less reliant on customizing the command to your liking and more towards freedom of action.
For your enjoyment, here it is in full glory. Hopefully the comments make it possible for code-illiterate people to understand what it is and how it works.
// Example of use: // cmd [ // [ condition 1 ] // [ condition 2 ] // ... // ] [ // [ on-success 1 ] // [ on-success 2 ] // ... // ] [ // [ on-failure 1 ] // [ on-failure 2 ] // ... // ] [ action ] // note 1: each condition that tests negative will terminate the script. // note 2: all conditions must test positive for the action to run. cmd = [ local tmp l // declares "tmp" and "l" as temporary variables for use within cmd only tmp = 0 // giving our variable a value to boot l = (listlen $arg1) // total amount of conditions to check loopwhile i $l [>= $tmp 0] [ if ((at $arg1 $i)) [ do (at $arg2 $i) // execute custom action from second list on success tmp = (+ $tmp 1) // for every condition from the list that is true, add 1 to tmp ] [ do (at $arg3 $i) // execute custom action from third list on failure tmp = -1 // end the loop early if condition is false ] ] if (= $tmp $l) arg4 // will only run once all given conditions successfully pass ]