@zswarm/cli 0.2.5 → 0.2.6

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.
Files changed (2) hide show
  1. package/dist/cli.js +14 -1
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { HOST_COMMANDS, ZellijError, cliUsage, createServeTunnelManager, dispatchZswarm, parseCliArgv, runHostCommand, SERVE_AWAIT_SESSION_ENV, SERVE_CORE_VERSION, serveTokenFromEnv, serveChildEnv, startServe, } from "@zswarm/core";
2
+ import { HOST_COMMANDS, OP_NAMES, ZellijError, cliUsage, commandUsage, wantsHelp, createServeTunnelManager, dispatchZswarm, extractOp, parseCliArgv, runHostCommand, SERVE_AWAIT_SESSION_ENV, SERVE_CORE_VERSION, serveTokenFromEnv, serveChildEnv, startServe, } from "@zswarm/core";
3
3
  import { readBodyFile } from "./input.js";
4
4
  import { routingNotice } from "./output.js";
5
5
  /** Wait until `session` is a live Zellij session (a crew service creates it). */
@@ -27,6 +27,19 @@ if (argv.length === 0 || argv[0] === "-h" || argv[0] === "--help") {
27
27
  process.stderr.write(cliUsage());
28
28
  process.exit(argv.length === 0 ? 2 : 0);
29
29
  }
30
+ // `zswarm <command> --help` / `-h`: the command's own usage and the flags
31
+ // that apply to it, from the shared schema. Host subcommands were handled
32
+ // above and keep their existing help.
33
+ if (wantsHelp(argv)) {
34
+ const { op } = extractOp(argv);
35
+ if (OP_NAMES.includes(op)) {
36
+ process.stdout.write(commandUsage(op));
37
+ }
38
+ else {
39
+ process.stderr.write(cliUsage());
40
+ }
41
+ process.exit(0);
42
+ }
30
43
  let args;
31
44
  try {
32
45
  args = parseCliArgv(argv);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@zswarm/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "description": "zSwarm CLI — list, send, dump Zellij panes",
6
6
  "bin": {
7
7
  "zswarm": "./dist/cli.js"
8
8
  },
9
9
  "dependencies": {
10
- "@zswarm/core": "0.2.5"
10
+ "@zswarm/core": "0.2.6"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "22.14.1",