mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-18 20:49:53 +01:00
Use docopt for command arg parsing
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"github.com/asciinema/asciinema-cli/cli"
|
||||
"github.com/asciinema/asciinema-cli/util"
|
||||
)
|
||||
|
||||
@@ -13,17 +11,14 @@ type AuthCommand struct {
|
||||
apiToken string
|
||||
}
|
||||
|
||||
func NewAuthCommand(cfg *util.Config) cli.Command {
|
||||
func NewAuthCommand(cfg *util.Config) *AuthCommand {
|
||||
return &AuthCommand{
|
||||
apiURL: cfg.API.URL,
|
||||
apiToken: cfg.API.Token,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *AuthCommand) RegisterFlags(flags *flag.FlagSet) {
|
||||
}
|
||||
|
||||
func (c *AuthCommand) Execute(args []string) error {
|
||||
func (c *AuthCommand) Execute() 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user