Files
asciinema/commands/auth.go

32 lines
643 B
Go
Raw Normal View History

2014-08-02 22:26:39 +02:00
package commands
import (
"flag"
"fmt"
"github.com/asciinema/asciinema-cli/cli"
"github.com/asciinema/asciinema-cli/util"
)
2014-11-12 20:54:50 +01:00
type AuthCommand struct {
2014-11-15 13:33:20 +01:00
apiURL string
2014-11-12 20:54:50 +01:00
apiToken string
}
func NewAuthCommand(cfg *util.Config) cli.Command {
2014-08-02 22:26:39 +02:00
return &AuthCommand{
2014-11-15 13:33:20 +01:00
apiURL: cfg.API.URL,
apiToken: cfg.API.Token,
2014-08-02 22:26:39 +02:00
}
}
2014-11-12 20:54:50 +01:00
func (c *AuthCommand) RegisterFlags(flags *flag.FlagSet) {
2014-08-02 22:26:39 +02:00
}
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:")
2014-11-15 13:33:20 +01:00
fmt.Printf("%v/connect/%v\n", c.apiURL, c.apiToken)
2014-08-02 22:26:39 +02:00
return nil
}