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:
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"github.com/tomwright/dasel/internal/command"
|
"github.com/tomwright/dasel/internal/command"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@@ -10,7 +9,7 @@ func main() {
|
|||||||
cmd := command.NewRootCMD()
|
cmd := command.NewRootCMD()
|
||||||
command.ChangeDefaultCommand(cmd, "select", "-v", "--version", "help")
|
command.ChangeDefaultCommand(cmd, "select", "-v", "--version", "help")
|
||||||
if err := cmd.Execute(); err != nil {
|
if err := cmd.Execute(); err != nil {
|
||||||
_, _ = fmt.Fprintln(os.Stderr, "Error: "+err.Error())
|
cmd.PrintErrln("Error:", err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import (
|
|||||||
// NewRootCMD returns the root command for use with cobra.
|
// NewRootCMD returns the root command for use with cobra.
|
||||||
func NewRootCMD() *cobra.Command {
|
func NewRootCMD() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "dasel",
|
Use: "dasel",
|
||||||
Short: "Query and modify data structures using selector strings.",
|
Short: "Query and modify data structures using selector strings.",
|
||||||
|
SilenceErrors: true,
|
||||||
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
cmd.Version = internal.Version
|
cmd.Version = internal.Version
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
|
|||||||
Reference in New Issue
Block a user