-
Notifications
You must be signed in to change notification settings - Fork 435
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
Command aliases #1800
Comments
For the shell command, how would you go about using |
This comment was marked as resolved.
This comment was marked as resolved.
I don't really like this idea - but still thanks for your input @boydaihungst! Here's my reason: It takes a problem that only affects two commands ( To achieve this, we'd have to introduce these extra new fields ( Since these fields are at the same level, it becomes hard to understand their meanings out of context. For example, consider these combinations:
Also, it's hard to explain the behavior of these fields in the documentation because each field has its own context. If the same options appear in different commands in the future, it would be even more complicated. In one context, option In the original proposal, for example, I only introduced an Another advantage of command aliases is that they're still just strings, which means they can be used elsewhere. For example, for the future ya emit "! my-plugin --foo"
# Equivalent to:
ya emit "plugin my-plugin --args='--foo'" |
You're right. 👍 |
This proposal aims to introduce the concept of command aliases to simplify existing
shell
andplugin
commands.Alias commands are treated as special command markers, with everything following the marker considered parameters for the actual command. This allows:
to be rewritten as:
Here, the
;
marker representsshell '...' --confirm
. Similarly, it enables:to be written as:
In this case, the
!
marker stands forplugin --sync ... --args='...'
, greatly simplifying command writing.Note that the
;
and!
markers are not final and require further discussion — such as whether to use;;
or!!
instead of a single character. Also, we need to determine which marker to use for commands likeshell --confirm 'ya pub dds-cd --str "/tmp"'
, one possible way is:We also need to consider a separate marker for async plugins, i.e., just
plugin
without--sync
.The text was updated successfully, but these errors were encountered: