github.com/dmmcquay/sia@v1.3.1-0.20180712220038-9f8d535311b9/cmd/siac/bashcomplcmd.go (about)

     1  package main
     2  
     3  import "github.com/spf13/cobra"
     4  
     5  var (
     6  	bashcomplCmd = &cobra.Command{
     7  		Use:   "bash-completion [path]",
     8  		Short: "Creates bash completion file.",
     9  		Long: "Creates a bash completion file at the specified " +
    10  			"location.\n\n" +
    11  
    12  			"Note: Bash completions will only work with the " +
    13  			"prefix with which the script is created (e.g. " +
    14  			"`./siac` or `siac`).\n\n" +
    15  
    16  			"Once created, the file has to be moved to the bash " +
    17  			"completion script folder - usually " +
    18  			"`/etc/bash_completion.d/`.",
    19  		Run: wrap(bashcomplcmd),
    20  	}
    21  )
    22  
    23  func bashcomplcmd(path string) {
    24  	rootCmd.GenBashCompletionFile(path)
    25  }