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"
|
|
|
|
|
)
|
|
|
|
|
|
2014-08-09 23:39:23 +02:00
|
|
|
var (
|
|
|
|
|
Version string
|
|
|
|
|
Commit string
|
|
|
|
|
)
|
|
|
|
|
|
2014-08-02 22:27:17 +02:00
|
|
|
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() {
|
|
|
|
|
fmt.Printf("asciinema %v (%v)\n", Version, Commit)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.`)
|
|
|
|
|
}
|