refactor(commands): move login/logout under platform namespace
Problem: `:CP login codeforces` was inconsistent with every other command which uses `:CP <platform> <action>` ordering. Solution: restructure to `:CP codeforces login` / `:CP codeforces logout`. Remove `login`/`logout` from top-level `ACTIONS` and move parsing into the platform branch of `parse_command`. Update completion to offer `login`/`logout` as platform subcommands.
This commit is contained in:
parent
df934efb19
commit
ccaedfebc1
3 changed files with 6 additions and 9 deletions
|
|
@ -83,8 +83,6 @@ local function parse_command(args)
|
|||
else
|
||||
return { type = 'action', action = 'interact' }
|
||||
end
|
||||
elseif first == 'login' or first == 'logout' then
|
||||
return { type = 'action', action = first, platform = args[2] }
|
||||
elseif first == 'stress' then
|
||||
return {
|
||||
type = 'action',
|
||||
|
|
@ -245,6 +243,9 @@ local function parse_command(args)
|
|||
message = 'Too few arguments - specify a contest.',
|
||||
}
|
||||
elseif #args == 2 then
|
||||
if args[2] == 'login' or args[2] == 'logout' then
|
||||
return { type = 'action', action = args[2], platform = first }
|
||||
end
|
||||
return {
|
||||
type = 'contest_setup',
|
||||
platform = first,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue