This repository was archived by the owner on Mar 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import Login from "./subcommands/login";
7
7
import Logout from "./subcommands/logout" ;
8
8
import Settings from "./subcommands/settings" ;
9
9
import Version from "./subcommands/version" ;
10
+ import History from "./subcommands/history" ;
10
11
11
12
class KMDR {
12
13
private arg = arg ;
@@ -35,6 +36,7 @@ class KMDR {
35
36
. action ( this . info ) ;
36
37
this . arg . command ( "login [email]" ) . alias ( "l" ) . description ( "Log in to kmdr" ) . action ( this . login ) ;
37
38
this . arg . command ( "logout" ) . description ( "Log out from kmdr" ) . action ( this . logout ) ;
39
+ this . arg . command ( "history" ) . alias ( "h" ) . description ( "View command history" ) . action ( this . history ) ;
38
40
this . arg
39
41
. command ( "settings" )
40
42
. alias ( "s" )
@@ -58,6 +60,11 @@ class KMDR {
58
60
await explain . init ( ) ;
59
61
}
60
62
63
+ private async history ( ) {
64
+ const history = new History ( ) ;
65
+ await history . init ( ) ;
66
+ }
67
+
61
68
private async login ( email : string ) {
62
69
const login = new Login ( email ) ;
63
70
await login . init ( ) ;
Original file line number Diff line number Diff line change
1
+ import fs from "fs" ;
2
+ import fetch from "node-fetch" ;
3
+ import CLI from "../../Cli" ;
4
+ import { KmdrAuthError } from "../../errors" ;
5
+ import Print from "../../Print" ;
6
+
7
+ export default class HIstory extends CLI {
8
+ constructor ( ) {
9
+ super ( ) ;
10
+ }
11
+
12
+ public async init ( ) {
13
+ Print . text ( `Go to ${ this . KMDR_WEBAPP_URI } /history to view your command history` ) ;
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments