Closed jkremser closed 7 years ago
interesting, thanks.. could be good for command-line-commands too.. will look into it.
closing this for now as I don't see myself implementing it any time soon.. however, feel free to work on it and share the results here!
If this is implemented, this would be a killer feature. I like the way the args can be declaratively described by the hash. From that hash it would be possible to create the bash completion script. If this script is added to
/etc/bash_completion.d
it can complete the allowed args when pressing TAB.yargs
has something like that, but it's low lvl api and user needs to implement it basically itself. But these bash completion scripts could be generated. Btw. this is very nice way to do that almost mechanically: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/completion.go and the result is similar to this: https://github.com/janetkuo/kubernetes/blob/b673920ccf83c9448398243ff5ea3afab989d5fc/contrib/completions/bash/kubectl