mirror of
https://github.com/octoleo/restic.git
synced 2024-11-09 14:50:56 +00:00
Merge pull request #1240 from restic/config-autocomplete-dir
Correct bash completion file path
This commit is contained in:
commit
8a3889be11
@ -4,8 +4,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var autocompleteTarget string
|
||||
|
||||
var cmdAutocomplete = &cobra.Command{
|
||||
Use: "autocomplete",
|
||||
Short: "Generate shell autocompletion script",
|
||||
@ -28,10 +26,12 @@ $ sudo restic autocomplete`,
|
||||
},
|
||||
}
|
||||
|
||||
var autocompleteTarget string
|
||||
|
||||
func init() {
|
||||
cmdRoot.AddCommand(cmdAutocomplete)
|
||||
|
||||
cmdAutocomplete.Flags().StringVarP(&autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/restic.sh", "autocompletion file")
|
||||
cmdAutocomplete.Flags().StringVarP(&autocompleteTarget, "completionfile", "", "/usr/share/bash-completion/completions/restic", "autocompletion file")
|
||||
// For bash-completion
|
||||
cmdAutocomplete.Flags().SetAnnotation("completionfile", cobra.BashCompFilenameExt, []string{})
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ $ sudo restic autocomplete
|
||||
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
\fB\-\-completionfile\fP="/etc/bash\_completion.d/restic.sh"
|
||||
\fB\-\-completionfile\fP="/usr/share/bash\-completion/completions/restic"
|
||||
autocompletion file
|
||||
|
||||
.PP
|
||||
|
Loading…
Reference in New Issue
Block a user