-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.mjs
More file actions
executable file
·27 lines (23 loc) · 836 Bytes
/
cli.mjs
File metadata and controls
executable file
·27 lines (23 loc) · 836 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
#!/usr/bin/env node
import { Run } from "./dist/app.js";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
const args = yargs(hideBin(process.argv))
.usage("Usage: $0 [options] [dotfile]")
.example("$0", "interactively run the app")
.alias("d", "dotfile")
.describe("d", "Load dotfiles from a single markdown file")
.boolean("auto")
.describe("auto", "Auto-accept the provided file")
.boolean("demo")
.describe("demo", "Use the bundled demo files")
.example("$0 --auto README.md", "create every enabled dotfile in README.md")
.example("DEBUG=true $0", "run with verbose debugging")
.help("h")
.alias("h", "help")
.version()
.epilog("(GPL 2024)")
.parse();
// read explicit --file="" or implicit npx dotfiles-md SOMEFILE.md
args.dotfile = args.dotfile ?? args._[0];
Run("init", args);