Add command-{name|index} and !command-{name|index} condition to --success#318
Add command-{name|index} and !command-{name|index} condition to --success#318gustavohenke merged 7 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Hey @gustavohenke, the implementation looks good!
Basically, I like the solution with the command-{name|index} pattern. Just two thoughts from my side:
- The command name is not unique (while the index is), there can be multiple commands with the same name. It is important to understand that in this case, the command that has finished first (!) will be considered. Should we add a note for this?
- It can happen that the command with the specified name or index does not exist.
In the case of!command-concurrently exits with code 0, in the case ofcommand-concurrently exits with code 1. Should we cover this in a test case? Should we also add a note for this?
Addressed that. Now all commands with the same name must meet the same condition. Noteworthy: input handling also accepts a target command name, but it's also only sending it to the first matching command...
Covered it in tests -- might be fine to get away without more docs... I'd love to be able to write more about each flag, but |
| * - `command-{name|index}`: only the command with the specified name or index. | ||
| * - `!command-{name|index}`: all commands but the one with the specified name or index. |
There was a problem hiding this comment.
| * - `command-{name|index}`: only the command with the specified name or index. | |
| * - `!command-{name|index}`: all commands but the one with the specified name or index. | |
| * - `command-{name|index}`: only the commands with the specified name or index. | |
| * - `!command-{name|index}`: all commands but the ones with the specified name or index. |
|
Great work, LGTM!
Nice, that makes very much sense 👍
Okay, might be something to address in the future...
Fine for me, I think it's a rare case anyway 👍 Yeah, it would be handy to have a different place to to document such details! |
Implements 2 (or 4?) new possible conditions for
--successflag:command-{name|index}: command with the specified name or index must exit with 0;!command-{name|index}: all but the command with the specified name or index must exit with 0.I think that it expanding the use of
!to!firstand!lastcould come next, but for now that's an advanced enough solution!Closes #280.
Related: #281