-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command-{name|index} and !command-{name|index} condition to --success #318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
src/completion-listener.ts
Outdated
* - `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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* - `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
--success
flag: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!first
and!last
could come next, but for now that's an advanced enough solution!Closes #280.
Related: #281