feat: convert entire CLI to clibase (#6491)

I'm sorry.
This commit is contained in:
Ammar Bandukwala
2023-03-23 17:42:20 -05:00
committed by GitHub
parent b71b8daa21
commit 2bd6d2908e
345 changed files with 9965 additions and 9082 deletions
+2 -17
View File
@@ -1,27 +1,12 @@
package main
import (
"errors"
"fmt"
"math/rand"
"os"
"time"
_ "time/tzdata"
"github.com/coder/coder/cli"
"github.com/coder/coder/cli/cliui"
)
func main() {
rand.Seed(time.Now().UnixMicro())
cmd, err := cli.Root(cli.AGPL()).ExecuteC()
if err != nil {
if errors.Is(err, cliui.Canceled) {
os.Exit(1)
}
cobraErr := cli.FormatCobraError(err, cmd)
_, _ = fmt.Fprintln(os.Stderr, cobraErr)
os.Exit(1)
}
var rootCmd cli.RootCmd
rootCmd.RunMain(rootCmd.AGPL())
}