-
Notifications
You must be signed in to change notification settings - Fork 32
/
cli.js
executable file
·38 lines (37 loc) · 948 Bytes
/
cli.js
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
34
35
36
37
38
#!/usr/bin/env node
const yargs = require("yargs");
const relativeDeps = require("./index");
yargs
.usage("Usage: $0 <command> [options]")
.command({
command: "*",
describe: "Install relative deps",
handler: relativeDeps.installRelativeDeps
})
.command({
command: "watch",
describe: "Watch relative deps and install on change",
handler: relativeDeps.watchRelativeDeps
})
.command({
command: "init",
describe: "Initialize relative-deps",
handler: relativeDeps.initRelativeDeps
})
.command({
command: "add [paths...]",
describe: "Add path as relative dependencies",
handler: relativeDeps.addRelativeDeps
})
.option("D", {
alias: ["dev", "save-dev"],
description: "Save as dev dependency",
default: false,
type: "boolean"
})
.option("S", {
alias: ["script"],
description: "Script for relative-deps",
default: "prepare",
type: "string"
}).argv;