Added filename outoput for autocomplete verb. Modified debian package generator to include autocomplete. Added instructions to readme to build debian package.

This commit is contained in:
Renan DelValle 2018-12-05 15:12:49 -08:00
parent 61d78cb77e
commit ad4dd9606e
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
7 changed files with 36 additions and 4 deletions

View file

@ -5,7 +5,7 @@ import (
)
var completionCmd = &cobra.Command{
Use: "completion",
Use: "autocomplete",
Short: "Create auto completion for bash.",
Long: `Create auto completion bash file for australis. Auto completion file must be placed in the correct
directory in order for bash to pick up the definitions.
@ -18,10 +18,12 @@ In MacOS this directory is $(brew --prefix)/etc/bash_completion.d if auto comple
PersistentPreRun: func(cmd *cobra.Command, args []string) {}, //We don't need a realis client for this cmd
PersistentPostRun: func(cmd *cobra.Command, args []string) {}, //We don't need a realis client for this cmd
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenBashCompletionFile("australis.completion.sh")
rootCmd.GenBashCompletionFile(filename)
},
}
func init() {
rootCmd.AddCommand(completionCmd)
completionCmd.Flags().StringVar(&filename, "filename", "australis.completion.sh", "Path and name of the autocompletion file.")
}