feat: add :CP login command for explicit credential management
Problem: credentials were only set implicitly on first :CP submit. There was no way to update wrong credentials, log out, or set credentials ahead of time without editing the cache JSON manually. Solution: add :CP login [platform] which always prompts for username and password and overwrites any saved credentials for that platform. Omitting the platform falls back to the active platform. Wire the command through constants, parse_command, handle_command, and add tab-completion (suggests platform names). Document in vimdoc under the SUBMIT section and in the commands reference.
This commit is contained in:
parent
a08d1f0c5e
commit
3e0b7beabf
5 changed files with 66 additions and 4 deletions
|
|
@ -433,10 +433,20 @@ COMMANDS *cp-commands*
|
|||
Cancel an active race countdown.
|
||||
|
||||
Submit Commands ~
|
||||
:CP login [platform]
|
||||
Set or update stored credentials for a platform.
|
||||
Always prompts for username and password,
|
||||
overwriting any previously saved credentials.
|
||||
If [platform] is omitted, uses the active platform.
|
||||
Examples: >
|
||||
:CP login atcoder
|
||||
:CP login codeforces
|
||||
<
|
||||
:CP submit [--lang {language}]
|
||||
Submit the current solution to the online
|
||||
judge. Prompts for credentials on first use
|
||||
and stores them for subsequent submissions.
|
||||
judge. Uses stored credentials (set via
|
||||
:CP login). Prompts on first use if no
|
||||
credentials are saved.
|
||||
--lang: Submit solution for a specific language.
|
||||
|
||||
State Restoration ~
|
||||
|
|
@ -947,9 +957,18 @@ SUBMIT *cp-submit*
|
|||
|
||||
Submit the current solution to the online judge.
|
||||
|
||||
:CP login [platform] *cp-login*
|
||||
Set or update stored credentials for a platform. Always prompts for
|
||||
username and password, overwriting any previously saved credentials.
|
||||
Omit [platform] to use the currently active platform.
|
||||
|
||||
Credentials are stored in the main cache file under _credentials.
|
||||
Use this command before submitting for the first time, or any time
|
||||
you need to update stored credentials.
|
||||
|
||||
:CP submit [--lang {language}]
|
||||
Submit the current solution. Prompts for credentials on first use
|
||||
and stores them for subsequent submissions.
|
||||
Submit the current solution. Uses stored credentials (set via
|
||||
:CP login). Prompts on first use if no credentials are saved.
|
||||
--lang: Override the language to submit.
|
||||
|
||||
Platform support:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue