Conversation
| . < (dgraph completion) | ||
| `, | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| RootCmd.GenBashCompletion(os.Stdout) |
There was a problem hiding this comment.
Error return value of RootCmd.GenBashCompletion is not checked (from errcheck)
|
Tried it out. It seems pretty useful. Here's what it like it action ( |
dgraph completion command with two subcommands for bash and zsh.
|
Zsh completion isn't working for me. |
codexnull
left a comment
There was a problem hiding this comment.
I agree that shell completion would be helpful but I'm not sure that it should be a core dgraph command. The output is fixed for a given dgraph release. The same could be accomplished by just adding static completion files to the release package.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @srfrog)
manishrjain
left a comment
There was a problem hiding this comment.
This is useful. Either the user or our install scripts can use this to set up auto-completion based on whichever version dgraph is.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @srfrog)
srfrog
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @golangcibot)
dgraph/cmd/root.go, line 167 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
Error return value of
RootCmd.GenBashCompletionis not checked (fromerrcheck)
Done.
* dgraph/cmd/root.go: add bash shell completion command * dgraph/cmd/root.go: add zsh shell completion dgraph completion command with two subcommands for bash and zsh. * dgraph/cmd/root.go: add usage instructions and help
This PR adds a new
completioncommand to the Dgraph main binary. It is used to generate bash and zsh shell completion code.Bash example:
This change is