---
id: TASK-31
title: Add CLI parsing tests for workspace management commands
status: Done
assignee:
  - codex
created_date: '2026-03-04 22:17'
updated_date: '2026-03-04 22:19'
labels: []
dependencies: []
references:
  - src/core/cli.rs
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Workspace management adds new CLI subcommands and args (workspace/ws, init/update/export/apply with flags). Add unit tests to ensure clap parsing for these commands and aliases is correct and stable.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 CLI parses `kaze workspace init -f` (and `kaze ws i -f`) into `Command::Workspace(WsCommand::Init)` with `force=true`.
- [x] #2 CLI parses `kaze ws update` and `kaze ws u` into `WsCommand::Update`.
- [x] #3 CLI parses `kaze ws export` and `kaze ws e` into `WsCommand::Export`.
- [x] #4 CLI parses `kaze ws apply -f -n` (and alias `a`) into `WsCommand::Apply` with `force=true` and `noupdate=true`.
- [x] #5 Tests live in `src/core/cli.rs` alongside existing CLI parsing tests and pass under `just check`.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Add CLI parsing tests in src/core/cli.rs under the existing #[cfg(test)] module to cover workspace/ws subcommands and aliases.
2) For each command, assert Command::Workspace variant and verify subcommand args (force/noupdate).
3) Cover full and alias forms: workspace init + ws i, ws update + ws u, ws export + ws e, ws apply -f -n + ws a -f -n.
4) Run just check to confirm tests pass.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added CLI parsing tests for workspace subcommands and aliases using matches! patterns. Ran `just check -- -D warnings` (passes).
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added CLI parsing tests for workspace management subcommands and aliases (init/update/export/apply) in `src/core/cli.rs`, verifying flags via pattern matching. Tests: `just check -- -D warnings`.
<!-- SECTION:FINAL_SUMMARY:END -->
