CR95: Optionen je Befehl – ein Befehl weist ab, was er nicht hat (D042) #75

Merged
oliver.maklott merged 1 commit from cr95-options-per-command into main 2026-11-28 13:16:33 +01:00

apcmd las Optionen aus einer Liste für alle Befehle; pack remove x@1 --dry-run --yes entfernte, rollback --dry-run ging zurück. Jetzt nennt src/options.ts je Befehl und Unterbefehl seine Optionen, und main prüft das Getippte, bevor etwas geschieht. Schließt das „Offen“ von D041. Kein Versionssprung.

  • Fremde Option: „Unbekannte Option …“ mit dem Hilfenamen des Befehls, Exit-Code 2, kein Aufruf, keine Frage, nichts geschrieben
  • Eine Tabelle, zentral geprüft; Test hält sie gegen dispatch, Hilfetexte, Übersichten und alle Beispiele in Hilfe und README
  • Global bleiben --json, --lang, --help, --dir, --instance; configure --op (D024) bleibt
  • install weist --instance ab (es benennt mit --name; bisher stillschweigend ignoriert)
  • Tests: zerstörende Befehle mit --dry-run tun nichts; gültige Aufrufe je Familie; jeder Befehl mit jeder fremden Option
  • Hilfe: apcmd pack --help nennt --yes bei pack remove
  • Entscheidung D042

Nicht Teil davon: --stage-host - wird schon bisher als „Unbekannte Option -“ abgewiesen (eigener Auftrag).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PVUe4hWqPfFUKC4KEEmcM2

apcmd las Optionen aus einer Liste für alle Befehle; `pack remove x@1 --dry-run --yes` entfernte, `rollback --dry-run` ging zurück. Jetzt nennt `src/options.ts` je Befehl und Unterbefehl seine Optionen, und `main` prüft das Getippte, bevor etwas geschieht. Schließt das „Offen“ von D041. Kein Versionssprung. - [x] Fremde Option: „Unbekannte Option …“ mit dem Hilfenamen des Befehls, Exit-Code 2, kein Aufruf, keine Frage, nichts geschrieben - [x] Eine Tabelle, zentral geprüft; Test hält sie gegen `dispatch`, Hilfetexte, Übersichten und alle Beispiele in Hilfe und README - [x] Global bleiben `--json`, `--lang`, `--help`, `--dir`, `--instance`; `configure --op` (D024) bleibt - [x] `install` weist `--instance` ab (es benennt mit `--name`; bisher stillschweigend ignoriert) - [x] Tests: zerstörende Befehle mit `--dry-run` tun nichts; gültige Aufrufe je Familie; jeder Befehl mit jeder fremden Option - [x] Hilfe: `apcmd pack --help` nennt `--yes` bei `pack remove` - [x] Entscheidung D042 Nicht Teil davon: `--stage-host -` wird schon bisher als „Unbekannte Option -“ abgewiesen (eigener Auftrag). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01PVUe4hWqPfFUKC4KEEmcM2
CR95: a command refuses an option it does not take, before it does anything (D042)
All checks were successful
check / check (pull_request) Successful in 19s
check / check (push) Successful in 23s
release / release (push) Successful in 2s
2a72f5ec1c
Options were parsed from one list for all commands, so `pack remove x@1
--dry-run --yes` removed the pack and `rollback --dry-run` rolled back.
src/options.ts now lists the options of every command and subcommand; main
checks what was typed against the command's list before an instance is chosen,
a question is asked or Docker is called, and answers like for any unknown
option (exit code 2). Global: --json, --lang, --help, --dir, --instance;
`install` does not take --instance (it names the new instance with --name).
`configure --op` (D024) stays as a silent second name.

Tests hold the table against dispatch, the help texts, the overviews and every
example in help and README, and try every command with every option it lacks.
The help of `apcmd pack` now names --yes for `pack remove`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4hWqPfFUKC4KEEmcM2
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aivopod/apcmd!75
No description provided.