Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 89701d5

Browse files
committed
New subcommand history
Shows a link to the webapp.
1 parent d1c2bd4 commit 89701d5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/kmdr.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Login from "./subcommands/login";
77
import Logout from "./subcommands/logout";
88
import Settings from "./subcommands/settings";
99
import Version from "./subcommands/version";
10+
import History from "./subcommands/history";
1011

1112
class KMDR {
1213
private arg = arg;
@@ -35,6 +36,7 @@ class KMDR {
3536
.action(this.info);
3637
this.arg.command("login [email]").alias("l").description("Log in to kmdr").action(this.login);
3738
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);
3840
this.arg
3941
.command("settings")
4042
.alias("s")
@@ -58,6 +60,11 @@ class KMDR {
5860
await explain.init();
5961
}
6062

63+
private async history() {
64+
const history = new History();
65+
await history.init();
66+
}
67+
6168
private async login(email: string) {
6269
const login = new Login(email);
6370
await login.init();

src/subcommands/history/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

0 commit comments

Comments
 (0)