Skip to content

Commit

Permalink
chore: remove Error and newline prefix in the command line error mesaage
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Dec 7, 2023
1 parent b03c697 commit 4fde9aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions cmd/kcl/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ scenarios. The KCL website: https://kcl-lang.io
// New creates a new cobra client
func New() *cobra.Command {
cmd := &cobra.Command{
Use: cmdName,
Short: "The KCL Command Line Interface (CLI).",
Long: rootDesc,
SilenceUsage: true,
Version: version.GetVersionString(),
Use: cmdName,
Short: "The KCL Command Line Interface (CLI).",
Long: rootDesc,
SilenceUsage: true,
SilenceErrors: true,
Version: version.GetVersionString(),
}
// Language commands
cmd.AddCommand(NewRunCmd())
Expand Down
5 changes: 4 additions & 1 deletion cmd/kcl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
package main

import (
"fmt"
"os"
"strings"

"kcl-lang.io/cli/cmd/kcl/commands"
cmd "kcl-lang.io/cli/cmd/kcl/commands"
)

func main() {
if err := cmd.New().Execute(); err != nil {
fmt.Fprintln(os.Stderr, strings.TrimLeft(err.Error(), "\n"))
os.Exit(1)
}
}

0 comments on commit 4fde9aa

Please sign in to comment.