From 14fa91d9a4f2c2ba6a1a70902f5003778093cc5f Mon Sep 17 00:00:00 2001 From: phil-accelbyte <225106921+phil-accelbyte@users.noreply.github.com> Date: Tue, 5 May 2026 18:31:59 +0800 Subject: [PATCH] fix(help): correct stale command examples in help text and error hints - ags iam users list -> ags iam users search (no list method exists) - ags platform item create -> ags platform items create (resource is plural; add required --store-id) - Update root help, describe long_about, auth login long_about, and "user not found" error suggestions Tests updated to match the new expected strings. --- src/invocation/builder.rs | 8 ++++---- src/runtime/dispatch/error_codes/iam.rs | 2 +- src/runtime/dispatch/error_codes/standard.rs | 2 +- tests/functional/root.rs | 2 +- tests/integration/error_pipeline.rs | 2 +- tests/snapshot/help_text.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/invocation/builder.rs b/src/invocation/builder.rs index b50472d..0820d88 100644 --- a/src/invocation/builder.rs +++ b/src/invocation/builder.rs @@ -37,8 +37,8 @@ fn build_root_shell() -> Command { let root_after_help = format!( "{}:\n \ ags auth login\n \ - ags iam users list --namespace my-game\n \ - ags platform item create --namespace my-game --json @item.json\n\ + ags iam users search --namespace my-game\n \ + ags platform items create --namespace my-game --store-id main --json @item.json\n\ \n\ {}:\n \ 0 = success\n \ @@ -369,7 +369,7 @@ pub fn build_describe_command() -> Command { \x20 ags describe outputs all services\n\ \x20 ags describe iam outputs resources within a service\n\ \x20 ags describe iam users outputs methods within a resource\n\ - \x20 ags describe iam users list outputs full parameter schema for a method\n\n\ + \x20 ags describe iam users search outputs full parameter schema for a method\n\n\ \x20 Output is always JSON. No authentication required.", ) .arg(Arg::new("service").help("Service name")) @@ -462,7 +462,7 @@ fn build_login_subcommand() -> Command { \x20 IAM client. You will be prompted for any values not provided\n\ \x20 via flags or environment.\n\n\ \x20 Access token (pre-authenticated):\n\n\ - \x20 AGS_ACCESS_TOKEN= ags iam users list ...\n\n\ + \x20 AGS_ACCESS_TOKEN= ags iam users search ...\n\n\ \x20 Bypass login entirely with a pre-obtained token. No\n\ \x20 credentials are stored.\n\n\ \x20 Resolution order:\n\n\ diff --git a/src/runtime/dispatch/error_codes/iam.rs b/src/runtime/dispatch/error_codes/iam.rs index 0e4aaca..0ff0851 100644 --- a/src/runtime/dispatch/error_codes/iam.rs +++ b/src/runtime/dispatch/error_codes/iam.rs @@ -508,7 +508,7 @@ pub(super) fn lookup(error_code: i64) -> Option { 1014017 => Some(ErrorMapping { message: "User not found.", reason: Some("The user does not exist or is not accessible in this context."), - suggestion: Some("Run 'ags iam users list' to see available users."), + suggestion: Some("Run 'ags iam users search' to see available users."), tip: None, }), 1014018 => Some(ErrorMapping { diff --git a/src/runtime/dispatch/error_codes/standard.rs b/src/runtime/dispatch/error_codes/standard.rs index 30fde8e..444600a 100644 --- a/src/runtime/dispatch/error_codes/standard.rs +++ b/src/runtime/dispatch/error_codes/standard.rs @@ -47,7 +47,7 @@ pub(super) fn lookup(error_code: i64) -> Option { 20008 => Some(ErrorMapping { message: "User not found.", reason: Some("The user does not exist or is not accessible in this context."), - suggestion: Some("Run 'ags iam users list' to see available users."), + suggestion: Some("Run 'ags iam users search' to see available users."), tip: None, }), 20009 => Some(ErrorMapping { diff --git a/tests/functional/root.rs b/tests/functional/root.rs index cce3eab..5778dc4 100644 --- a/tests/functional/root.rs +++ b/tests/functional/root.rs @@ -93,7 +93,7 @@ fn test_root_help_shows_examples() { .success() .stdout(predicate::str::contains("Examples:")) .stdout(predicate::str::contains( - "ags iam users list --namespace my-game", + "ags iam users search --namespace my-game", )); } diff --git a/tests/integration/error_pipeline.rs b/tests/integration/error_pipeline.rs index b4b4187..d54eebc 100644 --- a/tests/integration/error_pipeline.rs +++ b/tests/integration/error_pipeline.rs @@ -142,7 +142,7 @@ fn test_classify_404_error() { .hint .as_deref() .unwrap_or("") - .contains("ags iam users list")); + .contains("ags iam users search")); } /// Unmapped 404s must singularize the resource name (e.g. "users" -> "User not found") for natural language output diff --git a/tests/snapshot/help_text.rs b/tests/snapshot/help_text.rs index 0b9c396..bf26ef8 100644 --- a/tests/snapshot/help_text.rs +++ b/tests/snapshot/help_text.rs @@ -71,8 +71,8 @@ fn test_root_help() { Examples: ags auth login - ags iam users list --namespace my-game - ags platform item create --namespace my-game --json @item.json + ags iam users search --namespace my-game + ags platform items create --namespace my-game --store-id main --json @item.json Exit codes: 0 = success