tursodatabase / turso-cli

Command line interface to Turso.

Home Page:https://turso.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve DX of api-tokens revoke

CodingDoug opened this issue · comments

The user should not be prompted to delete a token that doesn't exist:

$ go run cmd/turso/main.go auth api-tokens revoke foo
Are you sure you want to revoke this token? [y/n]: y
API token foo successfully revoked.

$ go run cmd/turso/main.go auth api-tokens revoke foo
Are you sure you want to revoke this token? [y/n]: y
Error: could not delete token foo from database
exit status 1

(this also yields an error in an internal slack room)

Instead, the token should be checked for existence first, and if it doesn't, output a message saying so.