Skip to content

geolocation-cli: route prompts through writer, add TTY guard, rename update-payment#3822

Merged
ben-dz merged 1 commit into
mainfrom
bdz/infra-1461
Jun 2, 2026
Merged

geolocation-cli: route prompts through writer, add TTY guard, rename update-payment#3822
ben-dz merged 1 commit into
mainfrom
bdz/infra-1461

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented Jun 2, 2026

Summary of Changes

  • Route confirmation prompts in init.rs, user/delete.rs, and probe/delete.rs through the injected Write parameter instead of eprint!, complying with RFC-20 rule 7
  • Add std::io::IsTerminal TTY guard so non-interactive contexts (CI, scripts) get a clear error directing them to pass --yes instead of hanging on stdin
  • Rename UserCommands::UpdatePayment to UpdatePaymentStatus so the CLI subcommand (user update-payment-status) matches the file and SDK naming
  • Fixes malbeclabs/infra#1461

Testing Verification

  • All 44 tests in doublezero-geolocation-cli pass, including 3 new tests verifying non-TTY rejection for each destructive verb (init, user delete, probe delete)
  • cargo clippy -p doublezero-geolocation-cli -- -Dclippy::all -Dwarnings passes with no warnings
  • make rust-fmt applied with no formatting changes required

@ben-dz ben-dz marked this pull request as ready for review June 2, 2026 15:20
@ben-dz ben-dz requested a review from juan-malbeclabs June 2, 2026 15:20
Copy link
Copy Markdown
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…uard, rename update-payment

Replace eprint! with write!(out, ...) in init.rs, user/delete.rs, and
probe/delete.rs to comply with RFC-20 rule 7. Add IsTerminal check so
non-interactive contexts error with a message to pass --yes. Rename
UserCommands::UpdatePayment to UpdatePaymentStatus for consistency
with the file and SDK naming.

Refs: malbeclabs/infra#1461
@ben-dz ben-dz merged commit 4dd796c into main Jun 2, 2026
33 checks passed
@ben-dz ben-dz deleted the bdz/infra-1461 branch June 2, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants