File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,18 @@ import {version} from "../../package.json";
3
3
import { AtCoder } from "../atcoder" ;
4
4
import { OnlineJudge } from "../facade/oj" ;
5
5
import { init } from "../project" ;
6
+ import getConfig from "../config" ;
6
7
7
8
async function login ( ) {
8
9
const atcoder = new AtCoder ( ) ;
9
10
console . log ( await atcoder . login ( ) ) ;
10
11
}
11
12
13
+ async function logout ( ) {
14
+ getConfig ( ) . delete ( "cookies" ) ;
15
+ console . log ( "login session aborted." )
16
+ }
17
+
12
18
async function session ( ) {
13
19
const atcoder = new AtCoder ( ) ;
14
20
console . log ( "check login status..." ) ;
@@ -57,6 +63,11 @@ commander
57
63
. action ( async ( ) => await login ( ) )
58
64
. description ( "login to AtCoder" ) ;
59
65
66
+ commander
67
+ . command ( "logout" )
68
+ . action ( async ( ) => await logout ( ) )
69
+ . description ( "delete login session information" ) ;
70
+
60
71
commander
61
72
. command ( "session" )
62
73
. action ( async ( ) => await session ( ) )
You can’t perform that action at this time.
0 commit comments