-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcmd.ts
32 lines (25 loc) · 811 Bytes
/
cmd.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { program } from "commander";
import { version } from "./package.json";
export const cmd = () => {
let file = "";
program.name("dcv-decryptor").description("可能有用的玩意").version(version);
program
.argument("[file]", "")
.description("[file]: DCV文件路径")
.action((str) => {
file = str;
});
program.option("-e, --email <email>", "登录邮箱");
program.option("-pw, --password <password>", "登录密码");
program.option("-pk, --privatekey <privatekey>", "privatekey路径");
program.option("-ci, --clientid <clientid>", "clientid路径");
program.parse();
const options: {
email?: string;
password?: string;
privatekey?: string;
clientid?: string;
file?: string;
} = { ...program.opts(), file };
return options;
};