-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added bash completion and updated README.md
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// completionCmd represents the completion command | ||
var completionCmd = &cobra.Command{ | ||
Use: "completion", | ||
Short: "Generates bash completion scripts", | ||
Long: `To load completion run | ||
. <(vht completion) | ||
To configure your bash shell to load completions for each session add to your bashrc | ||
# ~/.bashrc or ~/.profile | ||
. <(vht completion) | ||
`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
_ = rootCmd.GenBashCompletion(cmd.OutOrStdout()); | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(completionCmd) | ||
} |