Skip to content

Commit

Permalink
add bash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
kobtea committed Sep 20, 2018
1 parent e40cb8a commit 3a7c570
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cmd/todoist/cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/spf13/cobra"
"os"
)

// completionCmd represents the completion command
var completionCmd = &cobra.Command{
Use: "completion",
Short: "generate completion script",
}

var completionBashCmd = &cobra.Command{
Use: "bash",
Short: "generate bash completion script",
Run: func(cmd *cobra.Command, args []string) {
RootCmd.GenBashCompletion(os.Stdout)
},
}

func init() {
RootCmd.AddCommand(completionCmd)
completionCmd.AddCommand(completionBashCmd)
}

0 comments on commit 3a7c570

Please sign in to comment.