@jx0/jmux 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/main.ts +13 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx0/jmux",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "A persistent session sidebar for tmux",
5
5
  "type": "module",
6
6
  "bin": {
package/src/main.ts CHANGED
@@ -12,7 +12,7 @@ import { homedir } from "os";
12
12
 
13
13
  // --- CLI commands (run and exit before TUI) ---
14
14
 
15
- const VERSION = "0.1.5";
15
+ const VERSION = "0.2.0";
16
16
 
17
17
  const HELP = `jmux — a persistent session sidebar for tmux
18
18
 
@@ -120,10 +120,19 @@ const configFile = resolve(jmuxDir, "config", "tmux.conf");
120
120
  let sessionName: string | undefined;
121
121
  let socketName: string | undefined;
122
122
  for (let i = 2; i < process.argv.length; i++) {
123
- if (process.argv[i] === "--socket" || process.argv[i] === "-L") {
123
+ const arg = process.argv[i];
124
+ if (arg === "--socket" || arg === "-L") {
124
125
  socketName = process.argv[++i];
125
- } else if (!sessionName && !process.argv[i].startsWith("-")) {
126
- sessionName = process.argv[i];
126
+ } else if (arg.startsWith("-")) {
127
+ console.error(`Unknown option: ${arg}`);
128
+ console.error("Run 'jmux --help' for usage.");
129
+ process.exit(1);
130
+ } else if (!sessionName) {
131
+ sessionName = arg;
132
+ } else {
133
+ console.error(`Unexpected argument: ${arg}`);
134
+ console.error("Run 'jmux --help' for usage.");
135
+ process.exit(1);
127
136
  }
128
137
  }
129
138
  const cols = process.stdout.columns || 80;