Fix CLI token set command

This commit is contained in:
2026-09-13 10:34:28 +02:00
parent 594d5d0150
commit 3d8d1e5a66
3 changed files with 67 additions and 5 deletions
+10 -3
View File
@@ -28,7 +28,14 @@ Usage:
A token grants its own size and lifetime limits. Any limit left unset is
inherited from the running server's defaults, so a token with no options
behaves exactly like the anonymous tier but may claim vanity names.
behaves exactly like the anonymous tier.
"set" changes only what you name on the command line; anything you leave out
keeps its current value. Give a limit an empty value to go back to inheriting
the server's default, and turn a flag off with "=false":
uncensored-send token set friend --max-size= inherit the default again
uncensored-send token set friend --vanity=false revoke custom names
Options:
`
@@ -144,8 +151,8 @@ func (o *tokenOptions) register() *config.Set {
fs.String(&o.defExpiry, "default-expiry", "", "", "DURATION", "lifetime applied when this token does not ask for one")
fs.String(&o.chosen, "token", "t", "", "VALUE",
"use this token instead of a generated one; \"-\" reads it from standard input")
fs.Bool(&o.vanity, "vanity", "", false, "allow this token to claim custom names")
fs.Bool(&o.admin, "admin", "", false, "allow this token to delete anyone's files")
fs.Bool(&o.vanity, "vanity", "", false, "allow this token to claim custom names; --vanity=false revokes it")
fs.Bool(&o.admin, "admin", "", false, "allow this token to delete anyone's files; --admin=false revokes it")
return fs
}