mirror of https://gitea.com/webb/interrupt
49 lines
847 B
Go
49 lines
847 B
Go
package main
|
|
|
|
import (
|
|
"gitea.com/webb/teal"
|
|
"github.com/urfave/cli"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
var itCl = teal.Client{
|
|
UserAgent: "interrupt v0.0.0",
|
|
}
|
|
|
|
func main() {
|
|
cli := &cli.App{
|
|
Commands: []*cli.Command{
|
|
{
|
|
Name: "upload",
|
|
Aliases: []string{"u"},
|
|
Usage: "upload a file",
|
|
Action: func(c *cli.Context) error {
|
|
uploadHandler(c.Args().First())
|
|
return nil
|
|
},
|
|
},
|
|
{
|
|
Name: "get",
|
|
Aliases: []string{"g"},
|
|
Usage: "get information from your account",
|
|
Subcommands: []*cli.Command{
|
|
{
|
|
Name: "key",
|
|
Usage: "get your upload key by logging in with your username and password",
|
|
Action: func(c *cli.Context) error {
|
|
err := getAccountHandler("key")
|
|
return err
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
err := cli.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|