mirror of
https://gitea.com/jolheiser/sip
synced 2025-02-07 15:21:07 +01:00
Fix YAML New changes, generate docs, and add Drone for main Signed-off-by: jolheiser <john.olheiser@gmail.com> Merge branch 'master' of gitea.com:jolheiser/sip into vanity Change to vanity URL Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: jolheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/jolheiser/sip/pulls/37
31 lines
633 B
Go
31 lines
633 B
Go
package cmd
|
|
|
|
import (
|
|
"go.jolheiser.com/sip/config"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
"go.jolheiser.com/beaver"
|
|
"go.jolheiser.com/beaver/color"
|
|
)
|
|
|
|
var Tokens = cli.Command{
|
|
Name: "tokens",
|
|
Aliases: []string{"token"},
|
|
Usage: "Manage access tokens",
|
|
Action: doTokenList,
|
|
Subcommands: []*cli.Command{
|
|
&TokensAdd,
|
|
&TokensRemove,
|
|
},
|
|
}
|
|
|
|
func doTokenList(_ *cli.Context) error {
|
|
if len(config.Tokens) == 0 {
|
|
beaver.Errorf("No tokens found! Add one with %s", color.FgMagenta.Format("sip token create"))
|
|
}
|
|
for idx, token := range config.Tokens {
|
|
beaver.Infof("%d. %s (%s)", idx+1, token.Name, token.URL)
|
|
}
|
|
return nil
|
|
}
|