Skip to content

fix: correct init guidance, register deactivate command, fill LICENSE copyright - #24

Merged
HansRobo merged 1 commit into
mainfrom
fix/onboarding-deactivate-license
Jun 13, 2026
Merged

HansRobo merged 1 commit into
mainfrom
fix/onboarding-deactivate-license

Conversation

@HansRobo

Copy link
Copy Markdown
Owner

Summary

Fixes three small, user-facing issues from the §1 (High-value × Small) triage. All non-breaking; no behaviour change to existing flows.

  • init guidance bug — cwm init's "Next steps" printed cwm build, which was moved to ws build (main.py moved_commands). A first-time user following the printed instructions always hit an error. Now points at cwm ws build (cli/init_cmd.py).
  • deactivate unregistered — deactivate was never registered as a CLI command, so cwm deactivate without shell integration fell through to the colcon passthrough and produced a confusing colcon deactivate error. Registered as a real command (symmetric with cd/switch) that prints a shell-integration hint instead (cli/activate_cmd.py, cli/main.py). With shell integration active, the cwm() function still intercepts deactivate and calls the shell function from cwm activate, so the CLI command is only reached when integration is not set up — exactly where the hint helps.
  • LICENSE copyright — replaced the Apache template placeholder Copyright [yyyy] [name of copyright owner] with the actual holder (LICENSE).

Reuse / design notes

  • The deactivate command mirrors the existing cd/switch hint pattern (cli/cd_cmd.py): a visible command that raises a ClickException with setup guidance, preventing the colcon passthrough from swallowing it.
  • Added to cli.command_order right after activate so help output keeps the activate/deactivate pair together.

Tests

  • test_cd_cmd.py: new TestDeactivateCommand (exit≠0, output contains "shell integration"), matching TestCdCommand/TestSwitchCommand.
  • test_cli_structure.py: added deactivate to the expected top-level command order.
  • Targeted suite: 22 passed.

Verification (manual)

  • cwm deactivate (no shell integration) prints the shell-init hint and exits 1, instead of a colcon error.
  • cwm --help lists deactivate directly after activate.
  • cwm init "Next steps" shows cwm ws build.

… copyright

Fixes three small but user-facing issues from the §1 triage:

- init: the "Next steps" guidance pointed at the removed `cwm build`
  command, so first-time users following the printed instructions always
  hit an error. Now points at `cwm ws build`.
- deactivate: `deactivate` was never registered as a CLI command, so
  running `cwm deactivate` without shell integration fell through to the
  colcon passthrough and produced a confusing `colcon deactivate` error.
  Register it as a real command (symmetric with `cd`/`switch`) that
  prints a shell-integration hint instead.
- LICENSE: replaced the Apache template placeholder
  `Copyright [yyyy] [name of copyright owner]` with the actual copyright
  holder.
@HansRobo HansRobo added the release:patch Bump patch version on merge label Jun 13, 2026
@HansRobo
HansRobo merged commit 60e0c47 into main Jun 13, 2026
12 checks passed
@HansRobo
HansRobo deleted the fix/onboarding-deactivate-license branch June 13, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Bump patch version on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant