feat: huge overhaul of messaging into FAIL, WARN, hint, ok, prompt, and progress types
This commit is contained in:
parent
6ccd801c89
commit
b52a5bfdb7
30 changed files with 192 additions and 96 deletions
10
cmd/root.go
10
cmd/root.go
|
|
@ -31,18 +31,20 @@ import (
|
|||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "pda",
|
||||
Short: "A key-value store tool",
|
||||
Long: asciiArt,
|
||||
Use: "pda",
|
||||
Short: "A key-value store tool",
|
||||
Long: asciiArt,
|
||||
SilenceErrors: true, // we print errors ourselves
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
if configErr != nil {
|
||||
fmt.Fprintln(os.Stderr, "failed to load config:", configErr)
|
||||
printError(fmt.Errorf("cannot load config: %v", configErr))
|
||||
os.Exit(1)
|
||||
}
|
||||
err := rootCmd.Execute()
|
||||
if err != nil {
|
||||
printErrorWithHints(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue