Fix dynamic help usage service paths#840
Conversation
🦋 Changeset detectedLatest commit: 025e185 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
|
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. |
There was a problem hiding this comment.
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.
Fixes #839
Summary
gws <service>so service and resource help show the full command path.@googleworkspace/cli.Verification
RED:
cargo test -p google-workspace-cli commands::tests::test_help_usage_includes_service_name -- --nocaptureUsage: 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
cargo testwas not run because this change is limited to thegoogle-workspace-clicrate; the affected package test suite passed.cargo clippy -p google-workspace-cli --all-targets -- -D warningswas attempted, but it currently fails on existing warnings outside this change, includingcredential_store.rs,executor.rs, helper tests,setup.rs, andmain.rs.