-
Notifications
You must be signed in to change notification settings - Fork 159
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
alias with arguments does not take additional arguments into consideration #605
Comments
the concrete example I had was an alias like in this case you should be able to do But it doesn't - it just runs as if no arguments was passed. |
@quintesse any idea ? |
@maxandersen yes, that's how I designed it :-) Which might be wrong of course. But it follows the same idea as I actually thought about allowing some kind of syntax/option that says that additional arguments should be added instead of overriding the default ones but it's not something that's currently implemented. |
Well its broken no matter what as the Alias call without argument works but with argument it fails :) I think the usecase above is a great usecase where Aliases should allow appending of arguments. |
Ah so if you run |
Here is the issue:
now, but doing afaik both alias in bash/zsh/git the arguments are part of the alias, so anything additional are simply appended. |
Ok, but that means it does work as I at least intended, it's not broken, you just don't like how it works :-) |
I have no problem with changing it to the way you want btw. I considered both options at the time and just chose one. |
True :) I didn't realise this specific app ignored irrelevant flags:) |
I think appending actually gives value as it means you can simplify and compose. Where as with replacement you don't really get much help. |
My way of thinking was that in most cases the most difficult thing about an alias is the URL, hard to remember and hard to type. At the same time once you specify arguments there is often no way to "unspecify" them, so overriding them instead of appending them seemed useful. But I admit the choice was a somewhat arbitrary and I have no issue with doing it your way. |
The current behavior surprised me. I creating an alias named
I'm used to bash aliases. Consider:
|
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes jbangdev#605
@maxandersen I've created a PR for this, but it's somewhat of a breaking change of course, so you need to decide if you want this or not :-) |
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes jbangdev#605
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes jbangdev#605
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes jbangdev#605
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes jbangdev#605
Arguments passed to an alias are now appended to any arguments that are already defined in the alias instead of replacing them. Fixes #605
@robin-a-meade thanks for reminding us to fix this :) @quintesse thanks merged! and yes its a breaking change but a good one imo. |
when doing
jbang alias add something.java -S
, i.e. have the alias seeded with some argumentsthen doing
jbang something
works, butjbang something additionalarg
fails.we are somehow ignoring/combining arguments in a non-working fashion when using aliases.
The text was updated successfully, but these errors were encountered: