clawcontrol 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,14 +5,47 @@
5
5
  // re-exec with bun pointing at the bundled dist/index.js.
6
6
 
7
7
  import { execFileSync } from "node:child_process";
8
+ import { createRequire } from "node:module";
8
9
  import { fileURLToPath } from "node:url";
9
10
  import { dirname, resolve } from "node:path";
10
11
 
12
+ const args = process.argv.slice(2);
13
+
14
+ // Handle --version and --help without needing bun
15
+ if (args.includes("--version") || args.includes("-v")) {
16
+ const require = createRequire(import.meta.url);
17
+ const pkg = require("../package.json");
18
+ console.log(`clawcontrol v${pkg.version}`);
19
+ process.exit(0);
20
+ }
21
+
22
+ if (args.includes("--help") || args.includes("-h")) {
23
+ const require = createRequire(import.meta.url);
24
+ const pkg = require("../package.json");
25
+ console.log(`
26
+ clawcontrol v${pkg.version}
27
+ ${pkg.description}
28
+
29
+ Usage:
30
+ clawcontrol Launch the interactive TUI
31
+ clawcontrol --help Show this help message
32
+ clawcontrol --version Show the version number
33
+
34
+ Options:
35
+ -h, --help Show this help message
36
+ -v, --version Show the version number
37
+
38
+ Documentation & source:
39
+ https://github.com/ipenywis/clawcontrol
40
+ `);
41
+ process.exit(0);
42
+ }
43
+
11
44
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
45
  const script = resolve(__dirname, "../dist/index.js");
13
46
 
14
47
  try {
15
- execFileSync("bun", [script, ...process.argv.slice(2)], {
48
+ execFileSync("bun", [script, ...args], {
16
49
  stdio: "inherit",
17
50
  });
18
51
  } catch (e) {