@leeandrew94/ccm 0.1.12 → 0.1.13
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.
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/bin/ccm.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Profile config file `~/.ccm/profiles.json` (managed via `ccm add` / `ccm edit`):
|
|
|
104
104
|
|
|
105
105
|
## Star History
|
|
106
106
|
|
|
107
|
-
[](https://www.star-history.com/?type=date&repos=leeandrew94%2Fccm-cli)
|
|
108
108
|
|
|
109
109
|
## License
|
|
110
110
|
|
package/README.zh.md
CHANGED
|
@@ -104,7 +104,7 @@ Profile 配置文件 `~/.ccm/profiles.json`(通过 `ccm add` / `ccm edit` 管
|
|
|
104
104
|
|
|
105
105
|
## Star History
|
|
106
106
|
|
|
107
|
-
[](https://www.star-history.com/?type=date&repos=leeandrew94%2Fccm-cli)
|
|
108
108
|
|
|
109
109
|
## License
|
|
110
110
|
|
package/bin/ccm.js
CHANGED
|
@@ -254,7 +254,7 @@ function cmdLaunch(args) {
|
|
|
254
254
|
writeRun(process.pid, args.name, "");
|
|
255
255
|
info(`Launching claude with profile '${args.name}'...`);
|
|
256
256
|
console.log();
|
|
257
|
-
const child = spawn("claude", ["--settings", settingsPath], {
|
|
257
|
+
const child = spawn("claude", ["--settings", settingsPath, ...args.extraArgs || []], {
|
|
258
258
|
stdio: "inherit"
|
|
259
259
|
});
|
|
260
260
|
child.on("exit", (code) => {
|
|
@@ -853,13 +853,14 @@ Shortcuts:
|
|
|
853
853
|
`);
|
|
854
854
|
}
|
|
855
855
|
function parseArgs(argv) {
|
|
856
|
-
const args = { _: [] };
|
|
856
|
+
const args = { _: [], extra: [] };
|
|
857
857
|
let i = 0;
|
|
858
858
|
while (i < argv.length) {
|
|
859
859
|
const arg = argv[i];
|
|
860
860
|
if (arg === "--all") {
|
|
861
861
|
args.all = true;
|
|
862
862
|
} else if (arg.startsWith("-")) {
|
|
863
|
+
args.extra.push(arg);
|
|
863
864
|
} else {
|
|
864
865
|
args._.push(arg);
|
|
865
866
|
}
|
|
@@ -895,14 +896,14 @@ async function main() {
|
|
|
895
896
|
const firstArg = rawArgs[0];
|
|
896
897
|
if (firstArg && !KNOWN_COMMANDS.has(firstArg) && !firstArg.startsWith("-")) {
|
|
897
898
|
if (profileExists(firstArg)) {
|
|
898
|
-
cmdLaunch({ name: firstArg });
|
|
899
|
+
cmdLaunch({ name: firstArg, extraArgs: rawArgs.slice(1) });
|
|
899
900
|
return;
|
|
900
901
|
}
|
|
901
902
|
}
|
|
902
903
|
const { command, args } = parseArgs(rawArgs);
|
|
903
904
|
switch (command) {
|
|
904
905
|
case "_launch":
|
|
905
|
-
cmdLaunch({ name: args.name });
|
|
906
|
+
cmdLaunch({ name: args.name, extraArgs: args.extra || [] });
|
|
906
907
|
break;
|
|
907
908
|
case "_register":
|
|
908
909
|
cmdRegister({ name: args.name, pid: args.pid, tty: args.tty });
|