fix(workstream): require name arg for set, add --clear flag (#1527)
workstream set with no argument silently cleared the active workstream, a footgun for users who forgot the name. Now requires a name arg and errors with usage hint. Explicit clearing via --clear flag, which also reports the previous workstream in its output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -339,9 +339,13 @@ function cmdWorkstreamComplete(cwd, name, options, raw) {
|
||||
// ─── Active Workstream Commands ──────────────────────────────────────────────
|
||||
|
||||
function cmdWorkstreamSet(cwd, name, raw) {
|
||||
if (!name) {
|
||||
if (!name || name === '--clear') {
|
||||
if (name !== '--clear') {
|
||||
error('Workstream name required. Usage: workstream set <name> (or workstream set --clear to unset)');
|
||||
}
|
||||
const previous = getActiveWorkstream(cwd);
|
||||
setActiveWorkstream(cwd, null);
|
||||
output({ active: null, cleared: true }, raw);
|
||||
output({ active: null, cleared: true, previous: previous || null }, raw);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user