From cbf175d9f7eec66c60bfe2e90324f1e9218b01da Mon Sep 17 00:00:00 2001 From: Varun Nuthalapati Date: Tue, 2 Jun 2026 09:00:13 -0700 Subject: [PATCH] docs(drive): clarify download command is for Workspace native formats, not binary files --- .changeset/fix-727-drive-download-docs.md | 5 + crates/google-workspace-cli/src/commands.rs | 109 +++++++++++++++++++- 2 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 .changeset/fix-727-drive-download-docs.md diff --git a/.changeset/fix-727-drive-download-docs.md b/.changeset/fix-727-drive-download-docs.md new file mode 100644 index 00000000..9cf509c9 --- /dev/null +++ b/.changeset/fix-727-drive-download-docs.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +docs(drive): clarify download command is for Workspace native formats, not binary files diff --git a/crates/google-workspace-cli/src/commands.rs b/crates/google-workspace-cli/src/commands.rs index 27324e42..3560199a 100644 --- a/crates/google-workspace-cli/src/commands.rs +++ b/crates/google-workspace-cli/src/commands.rs @@ -61,7 +61,7 @@ pub fn build_cli(doc: &RestDescription) -> Command { resource_names.sort(); for name in resource_names { let resource = &doc.resources[name]; - if let Some(cmd) = build_resource_command(name, resource) { + if let Some(cmd) = build_resource_command(&doc.name, name, resource) { root = root.subcommand(cmd); } } @@ -72,7 +72,10 @@ pub fn build_cli(doc: &RestDescription) -> Command { /// Recursively builds a Command for a resource. /// Returns None if the resource has no methods or sub-resources. -fn build_resource_command(name: &str, resource: &RestResource) -> Option { +/// +/// `service_name` is the top-level API service (e.g. `"drive"`) used to inject +/// service-specific help text into selected commands. +fn build_resource_command(service_name: &str, name: &str, resource: &RestResource) -> Option { let mut cmd = Command::new(name.to_string()) .about(format!("Operations on the '{name}' resource")) .subcommand_required(true) @@ -110,6 +113,32 @@ fn build_resource_command(name: &str, resource: &RestResource) -> Option Option