diff --git a/cmd/root.go b/cmd/root.go index a65e5f7373..34bf559b46 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -48,7 +48,7 @@ EXAMPLES: FLAGS: --params URL/query parameters JSON --data request body JSON (POST/PATCH/PUT/DELETE) - --as identity type: user | bot | auto (default: auto) + --as identity type: user | bot --format output format: json (default) | ndjson | table | csv | pretty --page-all automatically paginate through all pages --page-size page size (0 = use API default) diff --git a/internal/cmdutil/identity_flag.go b/internal/cmdutil/identity_flag.go index 1589120ea6..8dc320d453 100644 --- a/internal/cmdutil/identity_flag.go +++ b/internal/cmdutil/identity_flag.go @@ -14,8 +14,8 @@ import ( // AddAPIIdentityFlag registers the standard --as flag shape used by api/service commands. func AddAPIIdentityFlag(ctx context.Context, cmd *cobra.Command, f *Factory, target *string) { addIdentityFlag(ctx, cmd, f, target, identityFlagConfig{ - defaultValue: "auto", - usage: "identity type: user | bot | auto (default)", + defaultValue: "", + usage: "identity type: user | bot", completionValues: []string{"user", "bot"}, }) } @@ -26,7 +26,7 @@ func AddShortcutIdentityFlag(ctx context.Context, cmd *cobra.Command, f *Factory authTypes = []string{"user"} } addIdentityFlag(ctx, cmd, f, nil, identityFlagConfig{ - defaultValue: authTypes[0], + defaultValue: "", usage: "identity type: " + strings.Join(authTypes, " | "), completionValues: authTypes, }) diff --git a/internal/cmdutil/identity_flag_test.go b/internal/cmdutil/identity_flag_test.go index fa93d7263d..54d539583b 100644 --- a/internal/cmdutil/identity_flag_test.go +++ b/internal/cmdutil/identity_flag_test.go @@ -24,8 +24,8 @@ func TestAddAPIIdentityFlag_NonStrictMode(t *testing.T) { if flag.Hidden { t.Fatal("expected --as flag to be visible outside strict mode") } - if got := flag.DefValue; got != "auto" { - t.Fatalf("default value = %q, want %q", got, "auto") + if got := flag.DefValue; got != "" { + t.Fatalf("default value = %q, want empty string", got) } } @@ -49,7 +49,7 @@ func TestAddAPIIdentityFlag_StrictModeHidesFlagAndLocksDefault(t *testing.T) { } } -func TestAddShortcutIdentityFlag_UsesAuthTypes(t *testing.T) { +func TestAddShortcutIdentityFlag_NoDefault(t *testing.T) { f, _, _, _ := TestFactory(t, &core.CliConfig{AppID: "a", AppSecret: "s"}) cmd := &cobra.Command{Use: "test"} @@ -62,7 +62,7 @@ func TestAddShortcutIdentityFlag_UsesAuthTypes(t *testing.T) { if flag.Hidden { t.Fatal("expected --as flag to be visible outside strict mode") } - if got := flag.DefValue; got != "bot" { - t.Fatalf("default value = %q, want %q", got, "bot") + if got := flag.DefValue; got != "" { + t.Fatalf("default value = %q, want empty string", got) } }