Files
asciinema/main.go

47 lines
888 B
Go
Raw Normal View History

2014-08-02 22:27:17 +02:00
package main
import (
2014-08-09 23:39:23 +02:00
"fmt"
2014-08-02 22:27:17 +02:00
"os"
"github.com/asciinema/asciinema-cli/cli"
"github.com/asciinema/asciinema-cli/commands"
"github.com/asciinema/asciinema-cli/util"
)
func main() {
cli := &cli.CLI{
Commands: map[string]cli.CommandBuilderFunc{
2014-08-09 23:39:23 +02:00
"rec": commands.Record,
"auth": commands.Auth,
2014-08-02 22:27:17 +02:00
},
2014-08-09 23:39:23 +02:00
HelpFunc: help,
VersionFunc: version,
2014-08-02 22:27:17 +02:00
ConfigLoader: &util.FileConfigLoader{},
}
os.Exit(cli.Run(os.Args[1:]))
}
2014-08-09 23:39:23 +02:00
func version() {
var commitInfo string
if GitCommit != "" {
2014-09-07 12:02:11 +02:00
commitInfo = fmt.Sprintf("-%v", GitCommit)
}
fmt.Printf("asciinema %v%v\n", Version, commitInfo)
2014-08-09 23:39:23 +02:00
}
func help() {
fmt.Println(`usage: asciinema <command> [options]
Asciinema terminal recorder.
Commands:
rec Record asciicast
auth Assign local API token to asciinema.org account
Run "asciinema <command> -h" to see the options available for the given command.`)
}