Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incus: Display the alias expansion when execution of an alias fails #1464

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/incus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path"
"slices"

"github.com/kballard/go-shellquote"
"github.com/spf13/cobra"

incus "github.com/lxc/incus/v6/client"
Expand Down Expand Up @@ -337,7 +338,11 @@ If you already added a remote server, make it the default with "incus remote swi
}

// Default error handling
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
if os.Getenv("INCUS_ALIASES") == "1" {
fmt.Fprintf(os.Stderr, i18n.G("Error while executing alias expansion: %s\n"), shellquote.Join(os.Args...))
}

fmt.Fprintf(os.Stderr, i18n.G("Error: %v\n"), err)

// If custom exit status not set, use default error status.
if globalCmd.ret == 0 {
Expand Down
Loading
Loading