2014-08-02 22:26:39 +02:00
|
|
|
package commands
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2015-03-12 12:31:46 +01:00
|
|
|
"github.com/asciinema/asciinema/api"
|
2014-08-02 22:26:39 +02:00
|
|
|
)
|
|
|
|
|
|
2014-11-12 20:54:50 +01:00
|
|
|
type AuthCommand struct {
|
2015-03-12 12:31:46 +01:00
|
|
|
api api.API
|
2014-11-12 20:54:50 +01:00
|
|
|
}
|
|
|
|
|
|
2015-03-12 12:31:46 +01:00
|
|
|
func NewAuthCommand(api api.API) *AuthCommand {
|
|
|
|
|
return &AuthCommand{api}
|
2014-08-02 22:26:39 +02:00
|
|
|
}
|
|
|
|
|
|
2015-03-03 16:13:33 +01:00
|
|
|
func (c *AuthCommand) Execute() error {
|
2015-03-12 12:31:46 +01:00
|
|
|
fmt.Println("Open the following URL in a browser to register your API token and assign any recorded asciicasts to your profile:")
|
|
|
|
|
fmt.Println(c.api.AuthUrl())
|
2014-08-02 22:26:39 +02:00
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|