Skip to content

Fix dynamic help usage service paths#840

Open
cnYui wants to merge 1 commit into
googleworkspace:mainfrom
cnYui:codex/fix-help-usage-service-path
Open

Fix dynamic help usage service paths#840
cnYui wants to merge 1 commit into
googleworkspace:mainfrom
cnYui:codex/fix-help-usage-service-path

Conversation

@cnYui

@cnYui cnYui commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #839

Summary

  • Set the dynamic clap command bin name to gws <service> so service and resource help show the full command path.
  • Add a regression test for service-level and resource-level help usage.
  • Add a patch changeset for @googleworkspace/cli.

Verification

RED:

  • cargo test -p google-workspace-cli commands::tests::test_help_usage_includes_service_name -- --nocapture
    • Failed before the fix because service help rendered Usage: gws [OPTIONS] <COMMAND>.

GREEN:

  • cargo test -p google-workspace-cli commands::tests::test_help_usage_includes_service_name -- --nocapture - passed, 1 test.
  • cargo test -p google-workspace-cli - passed, 710 tests.
  • cargo fmt --check - passed.
  • cargo clippy -p google-workspace-cli --bin gws -- -D warnings - passed.
  • cargo run -p google-workspace-cli -- sheets --help | grep -E "^Usage:" - Usage: gws sheets [OPTIONS] <COMMAND>.
  • cargo run -p google-workspace-cli -- sheets spreadsheets --help | grep -E "^Usage:" - Usage: gws sheets spreadsheets [OPTIONS] <COMMAND>.
  • git diff --check - passed.

Not run / notes

  • Full workspace cargo test was not run because this change is limited to the google-workspace-cli crate; the affected package test suite passed.
  • cargo clippy -p google-workspace-cli --all-targets -- -D warnings was attempted, but it currently fails on existing warnings outside this change, including credential_store.rs, executor.rs, helper tests, setup.rs, and main.rs.

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 025e185

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@googleworkspace-bot googleworkspace-bot added the area: core Core CLI parsing, commands, error handling, utilities label Jun 9, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the user experience of the Google Workspace CLI by ensuring that generated help messages accurately represent the command hierarchy. By explicitly setting the binary name in the CLI configuration, users will now see the full command path in help menus, providing better clarity on how to invoke specific services and resources.

Highlights

  • Improved CLI Help Output: Updated the dynamic clap command configuration to include the service name in the binary path, ensuring that help usage strings correctly display the full command path (e.g., 'gws ').
  • Regression Testing: Added a new test case to verify that both service-level and resource-level help commands correctly reflect the service name in their usage output.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla

google-cla Bot commented Jun 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CLI command builder to include the service name in the help usage paths. It introduces the build_cli_for_service function, which sets the binary name to gws {service_name} using clap, and adds a corresponding unit test to verify the correct usage output. There are no review comments, and I have no additional feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output of gws <service> <resource> --help provides wrong Usage: format, omitting the <service> part

2 participants