mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Fix rec command builder
This commit is contained in:
16
api/api.go
16
api/api.go
@@ -9,6 +9,22 @@ type Api interface {
|
||||
CreateAsciicast(*Asciicast) (string, error)
|
||||
}
|
||||
|
||||
func New(url, token string) *AsciinemaApi {
|
||||
return &AsciinemaApi{
|
||||
url: url,
|
||||
token: token,
|
||||
}
|
||||
}
|
||||
|
||||
type AsciinemaApi struct {
|
||||
url string
|
||||
token string
|
||||
}
|
||||
|
||||
func (a *AsciinemaApi) CreateAsciicast(asciicast *Asciicast) (string, error) {
|
||||
return "/foo", nil
|
||||
}
|
||||
|
||||
type Asciicast struct {
|
||||
Command string
|
||||
Title string
|
||||
|
||||
@@ -15,7 +15,10 @@ import (
|
||||
)
|
||||
|
||||
func Record(flags *flag.FlagSet, cfg *util.Config) cli.Command {
|
||||
command := RecordCommand{}
|
||||
command := RecordCommand{
|
||||
Terminal: terminal.New(),
|
||||
Api: api.New(cfg.Api.Url, cfg.Api.Token),
|
||||
}
|
||||
|
||||
flags.StringVar(
|
||||
&command.Command,
|
||||
|
||||
Reference in New Issue
Block a user