forked from Bot-Academia/Disnod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
33 lines (26 loc) · 815 Bytes
/
Copy pathcli.js
File metadata and controls
33 lines (26 loc) · 815 Bytes
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
33
"use strict";
const program = require("commander");
const showBanner = require("node-banner");
const { version } = require("../package");
const chalk = require("chalk");
const create = require("../commands/create");
const pkg = require("../package");
// register version flag
// program.version(version);
// (async () => {
// await showBanner("Disnode", "CLI tool for discord.js");
// })();
program.version(pkg.version).usage("<command> [options]");
program
.command("create <appname>")
.description("create a basic template")
.action((appname) => {
create.execute(appname);
});
// parse args
program.parse(process.argv);
program.arguments("<command>").action((cmd) => {
program.outputHelp();
console.log(` ` + chalk.red(`\n Unknown command ${chalk.yellow(cmd)}.`));
console.log();
});