Closed aik099 closed 9 years ago
No, not at the moment (so this is a feature request).
But: program d TAB : r TAB TAB
would be the same as program deploy:run TAB
Are you sure? Because code, used to get command from application by name (see https://github.com/stecman/symfony-console-completion/blob/master/src/CompletionHandler.php#L84-L87) theoretically should also account for shortened command versions.
Yes - well, at least, it doesn't work for me!
Maybe something changed, I'm still using v0.4.4 - I'll test with the latest dev-master
Ah, I've found it. There 2 methods on console application:
get
- searched by exact matchfind
- searches by short command names tooSo instead of doing has
+ get
we should be doing find
+ catch exception on no match
or multiple match
and consider command as not found.
Sounds good! It's presumably going to be slow(er), particularly for the commands that are not found (you can't stop it doing the levenshtein-based findAlternatives()), but I imagine it's negligible
you can't stop it doing the levenshtein-based findAlternatives()
What is this?
Hmm ok, good to know that it's possible at least. Personally I don't see a huge benefit in adding support for this since, as @pjcdawkins hinted at, having auto-completion kind of makes shortcuts like these redundant.
My other concern is that having single character values in completion results ends up being a bit clunky; you'd normally type one letter and press tab, but if the shell gets d
and deploy
back, it'll complete to 'd' and require another character of input to finish the completion. This would need to be implemented to magically work, but not clutter the regular results.
having auto-completion kind of makes shortcuts like these redundant.
Not really. Instead pressing d TAB : TAB r TAB
to get deploy:run
you can press d : r
and that's all.
My other concern is that having single character values in completion results ends up being a bit clunky;
You misunderstood. I'm not changing what command names are auto-completed - still full command names with namespace there. I'm only changing fact, that when command-related stuff is auto-completed it will know the command from it's short name.
Here is PR to better illustrate this. Tests speak for themselves.
@aik099 - thanks, merged and released as 0.5.1.
I'm not using this right now, but I think it works as expected since tests pass for me.
@stecman , it's 00:58 where you living if I'm not mistaken? You should be sleeping right now ;)
Symfony Console allow to type
d:r
when command name isdeploy:run
. In such case wouldprogram d:r TAB
produce any auto-complete fordeploy:run
command?