1
0
mirror of https://gitea.com/jolheiser/sip synced 2024-11-22 19:51:58 +01:00
sip/cmd/token.go
jolheiser 039c227402
Move log in/out commands to tokens command
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-17 20:57:51 -06:00

26 lines
486 B
Go

package cmd
import (
"gitea.com/jolheiser/beaver"
"gitea.com/jolheiser/sip/modules/config"
"github.com/urfave/cli/v2"
)
var Tokens = cli.Command{
Name: "tokens",
Aliases: []string{"token"},
Usage: "Manage access tokens",
Action: doTokenList,
Subcommands: []*cli.Command{
&TokensAdd,
&TokensRemove,
},
}
func doTokenList(ctx *cli.Context) error {
for idx, token := range config.Tokens {
beaver.Infof("%d. %s (%s)", idx+1, token.Name, token.URL)
}
return nil
}