1package commands
2
3import (
4 "github.com/spf13/cobra"
5
6 "github.com/MichaelMure/git-bug/bridge/core"
7)
8
9func runBridgeTokenRm(cmd *cobra.Command, args []string) error {
10 err := core.RemoveToken(repo, args[0])
11 if err == nil {
12 return nil
13 }
14
15 err = core.RemoveGlobalToken(repo, args[0])
16 return err
17}
18
19var bridgeTokenRmCmd = &cobra.Command{
20 Use: "rm",
21 Short: "Remove token by Id.",
22 PreRunE: loadRepo,
23 RunE: runBridgeTokenRm,
24 Args: cobra.ExactArgs(1),
25}
26
27func init() {
28 bridgeTokenCmd.AddCommand(bridgeTokenRmCmd)
29}