From f4e87bb10b96b7f6a2afebc0fd528d584d6fd552 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Fri, 16 Jan 2026 16:42:29 +0100 Subject: [PATCH] fix: resource cmd with no args panics The logic I wrote to remap some resources to something else (organization membership to organization) for "resource commands" (like get, delete, edit) does not cover the use case where the first argument is omitted so it panics. For example: ``` datumctl get panic ``` With this fix it fallback to what the underline get command does (fails with a nice error) --- internal/cmd/utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmd/utils.go b/internal/cmd/utils.go index f91e750..13932f7 100644 --- a/internal/cmd/utils.go +++ b/internal/cmd/utils.go @@ -6,6 +6,10 @@ import ( func WrapResourceCommand(cmd *cobra.Command) *cobra.Command { preRunFunc := func(cmd *cobra.Command, args []string) error { + // if there are not args we let the underline command to deal with it. + if len(args) == 0 { + return nil + } // This mapping helps user during the getting started phase if args[0] == "organizations" || args[0] == "organization" { args[0] = "organizationmemberships"