refactor(credentials): rename set/clear to login/logout/clear

Problem: the `set` and `clear` subcommands don't clearly convey their
intent — `set` reads like a generic setter rather than an auth action,
and `clear` overloads single-platform and all-platform semantics in one
subcommand.

Solution: rename `set` to `login`, split `clear` into `logout`
(per-platform, defaults to active) and `clear` (all platforms). Update
parser, dispatcher, tab completion, and vimdoc.
This commit is contained in:
Barrett Ruth 2026-03-04 12:45:23 -05:00
parent 18a60da2d8
commit c689b3e462
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
4 changed files with 58 additions and 29 deletions

View file

@ -104,7 +104,7 @@ end, {
end
return filter_candidates(candidates)
elseif args[2] == 'credentials' then
return filter_candidates({ 'set', 'clear' })
return filter_candidates({ 'login', 'logout', 'clear' })
elseif args[2] == 'race' then
local candidates = { 'stop' }
vim.list_extend(candidates, platforms)
@ -126,7 +126,7 @@ end, {
cache.load()
local contests = cache.get_cached_contest_ids(args[3])
return filter_candidates(contests)
elseif args[2] == 'credentials' and vim.tbl_contains({ 'set', 'clear' }, args[3]) then
elseif args[2] == 'credentials' and vim.tbl_contains({ 'login', 'logout' }, args[3]) then
return filter_candidates(platforms)
elseif args[2] == 'cache' and args[3] == 'clear' then
local candidates = vim.list_extend({}, platforms)