mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
32 lines
643 B
Go
32 lines
643 B
Go
package commands
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
|
|
"github.com/asciinema/asciinema-cli/cli"
|
|
"github.com/asciinema/asciinema-cli/util"
|
|
)
|
|
|
|
type AuthCommand struct {
|
|
apiURL string
|
|
apiToken string
|
|
}
|
|
|
|
func NewAuthCommand(cfg *util.Config) cli.Command {
|
|
return &AuthCommand{
|
|
apiURL: cfg.API.URL,
|
|
apiToken: cfg.API.Token,
|
|
}
|
|
}
|
|
|
|
func (c *AuthCommand) RegisterFlags(flags *flag.FlagSet) {
|
|
}
|
|
|
|
func (c *AuthCommand) Execute(args []string) error {
|
|
fmt.Println("Open the following URL in your browser to register your API token and assign any recorded asciicasts to your profile:")
|
|
fmt.Printf("%v/connect/%v\n", c.apiURL, c.apiToken)
|
|
|
|
return nil
|
|
}
|