diff --git a/cmd/carapace/cmd/macros.go b/cmd/carapace/cmd/macros.go index 302a92e327..80ca08122e 100644 --- a/cmd/carapace/cmd/macros.go +++ b/cmd/carapace/cmd/macros.go @@ -9,6 +9,7 @@ import ( "github.com/rsteube/carapace" "github.com/rsteube/carapace-bin/pkg/actions" + spec "github.com/rsteube/carapace-spec" "github.com/spf13/cobra" ) @@ -44,6 +45,9 @@ func init() { } return carapace.ActionValuesDescribed(vals...).Invoke(carapace.Context{}).ToMultiPartsA(".") }), + carapace.ActionCallback(func(c carapace.Context) carapace.Action { + return spec.ActionMacro(c.Args[0]) + }), ) } diff --git a/cmd/carapace/cmd/root.go b/cmd/carapace/cmd/root.go index 41eaa64384..1feea602cd 100644 --- a/cmd/carapace/cmd/root.go +++ b/cmd/carapace/cmd/root.go @@ -297,7 +297,7 @@ func init() { case "-v", "--version": return carapace.ActionValues() case "--list": - return carapace.ActionExecute(listCmd).Shift(1) + return carapace.ActionExecute(listCmd).Shift(1).Usage("list") case "--run": return carapace.ActionExecute(runCmd).Shift(1) case "--schema":