mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-26 18:11:24 +08:00
- Global --dry-run flag and ECC_DRY_RUN=1 env var - Enriched preview: shows target file path, tool name, and command - --dry-run stripped from argv so command routing works correctly - Handles non-JSON and empty stdin gracefully (session/stop hooks) - 10 tests covering isDryRun(), hook gating, enriched output, CLI routing
This commit is contained in:
+19
-1
@@ -106,6 +106,7 @@ ECC selective-install CLI
|
||||
Usage:
|
||||
ecc <command> [args...]
|
||||
ecc [install args...]
|
||||
ecc --dry-run <command> [args...]
|
||||
|
||||
Commands:
|
||||
${PRIMARY_COMMANDS.map(command => ` ${command.padEnd(15)} ${COMMANDS[command].description}`).join('\n')}
|
||||
@@ -115,6 +116,9 @@ Compatibility:
|
||||
ecc [args...] Without a command, args are routed to "install"
|
||||
ecc help <command> Show help for a specific command
|
||||
|
||||
Global Flags:
|
||||
--dry-run Preview actions without executing (sets ECC_DRY_RUN=1)
|
||||
|
||||
Examples:
|
||||
ecc typescript
|
||||
ecc install --profile developer --target claude
|
||||
@@ -152,7 +156,21 @@ function resolveCommand(argv) {
|
||||
return { mode: 'help' };
|
||||
}
|
||||
|
||||
const [firstArg, ...restArgs] = args;
|
||||
if (args.includes('--dry-run')) {
|
||||
process.env.ECC_DRY_RUN = '1';
|
||||
}
|
||||
|
||||
let cmdStart = 0;
|
||||
while (cmdStart < args.length && args[cmdStart] === '--dry-run') {
|
||||
cmdStart++;
|
||||
}
|
||||
|
||||
if (cmdStart >= args.length) {
|
||||
return { mode: 'help' };
|
||||
}
|
||||
|
||||
const firstArg = args[cmdStart];
|
||||
const restArgs = args.slice(cmdStart + 1);
|
||||
|
||||
if (firstArg === '--help' || firstArg === '-h') {
|
||||
return { mode: 'help' };
|
||||
|
||||
Reference in New Issue
Block a user