rwxrob / compcmd

Apache License 2.0
0 stars 0 forks source link

Completion limited to only one param #2

Open murtaza-u opened 2 years ago

murtaza-u commented 2 years ago

Current behaviour

z install <TAB>
help    kubectl   minikube   gh

z install minikube<TAB> minikube<TAB> minikube<TAB> minikube

Expected behaviour

z install <TAB>
help    kubectl   minikube   gh

z install minikube <TAB>
kubectl   gh

z install minikube kube<TAB>

z install minikube kubectl

Notice how help disappears after the first argument minikube is completed. This is because help is a command(or a sub-command). Let's think of commands as branches, sub-commands as sub-branches and params as leaves. Multiple params(minikube, kubectl, gh) can be passed to a command(z) but only one sub-command can be passed to it(here help). The sub-command will then have it's own sub-branches and leaves.

yemaney commented 8 months ago

@murtaza-u Is there a reason you canceled your pull request for this issue? I'm actually using your code in my own bonzai tree.

murtaza-u commented 6 months ago

@murtaza-u Is there a reason you canceled your pull request for this issue? I'm actually using your code in my own bonzai tree.

I no longer use bonzai since it is no longer maintained. I've switched to using urfave/cli, which offers the same composability as bonzai along with a bunch of additional features. I've also migrated my bonzai tree to use urfave/cli. Here is the repo in case someone wants to reference it: https://github.com/murtaza-u/z.