1
0
mirror of https://github.com/TomWright/dasel.git synced 2022-05-22 02:32:45 +03:00

Clean up error output

This commit is contained in:
Tom Wright
2021-11-09 16:56:05 +00:00
parent 4d7d1c2280
commit 298479efbe
2 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"fmt"
"github.com/tomwright/dasel/internal/command"
"os"
)
@@ -10,7 +9,7 @@ func main() {
cmd := command.NewRootCMD()
command.ChangeDefaultCommand(cmd, "select", "-v", "--version", "help")
if err := cmd.Execute(); err != nil {
_, _ = fmt.Fprintln(os.Stderr, "Error: "+err.Error())
cmd.PrintErrln("Error:", err.Error())
os.Exit(1)
}
}

View File

@@ -10,8 +10,10 @@ import (
// NewRootCMD returns the root command for use with cobra.
func NewRootCMD() *cobra.Command {
cmd := &cobra.Command{
Use: "dasel",
Short: "Query and modify data structures using selector strings.",
Use: "dasel",
Short: "Query and modify data structures using selector strings.",
SilenceErrors: true,
SilenceUsage: true,
}
cmd.Version = internal.Version
cmd.AddCommand(