fix(cli): exit codes, option handling and Ctrl+C for accounts and dry runs; the log follows GCLO_DATA_DIR #160

Merged
james.maes merged 2 commits from fix/159-cli into main 2026-11-10 22:53:06 +00:00
2 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.2 7d55b24906 fix(cli): address the independent review of the command-line fixes
An edit of an account removed meanwhile, and credential-store or accounts
file failures in 'sync --account', are fatal errors with their reason, not
unexpected ones. A change to the accounts is let through to its end on
Ctrl+C. The target folder is checked before the token is read, and what
cannot be a folder is refused. A credential-store failure says what its
number means. Help and docs match.

Refs #159

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 16:53:00 -06:00
james.maesandClaude Fable 5.2 7334ee21fc fix(cli): exit codes, option handling and Ctrl+C for accounts and dry runs; the log follows GCLO_DATA_DIR
- `gclo sync --dry-run` canceled while the repositories were being
  listed exited 0 with an empty plan. It now says it was canceled, prints
  no plan, and exits 1.
- `gclo accounts`: a failure of the accounts file or of Windows Credential
  Manager ended with exit code 70 ("please report it") where the help
  promises 2. It is now a fatal error with its reason (2), or "retry
  later" (4) when another gclo process was changing the accounts.
- `gclo accounts -h` was an unknown subcommand. `--description=` was
  rejected although `--description ""` works.
- `gclo accounts edit` accepted a blank --rename, --org, or --target.
- A relative --target was stored as typed, so an account meant a
  different folder depending on where it was used from. It is stored as a
  full path.
- The CLI's activity log ignored GCLO_DATA_DIR while accounts and settings
  followed it. The log folder is now "logs" under the data folder for the
  app and the CLI alike (GcloPaths.LogDirectory).
- Ctrl+C: the first one was held back ("Canceling...") also for commands
  that never look at the request (`accounts`) and while waiting at the
  token prompt, and then nothing happened. It is held back only where
  something acts on it (CancelKeyPolicy).

Closes #159

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 16:34:43 -06:00