```plaintext
bun run index.ts -- --input ./examples/echo.json
-$ echo value1 value3 value5
value1 value3 value5
-
-$ echo value1 value3 value6
value1 value3 value6
-
-$ echo value1 value4 value5
value1 value4 value5
-
-$ echo value1 value4 value6
value1 value4 value6
-
-$ echo value2 value3 value5
value2 value3 value5
-
-$ echo value2 value3 value6
value2 value3 value6
-
-$ echo value2 value4 value5
value2 value4 value5
-
-$ echo value2 value4 value6
value2 value4 value6
```
+Pass `--show-command` and/or `--show-args` to log the command and/or args specified in the input JSON:
+
+```plaintext
+bun run index.ts -- --input ./examples/echo.json --show-command --show-args
+
+$ echo value1 value3 value5
+┌──────┬────────┐
+│ │ Values │
+├──────┼────────┤
+│ arg1 │ value1 │
+│ arg2 │ value3 │
+│ arg3 │ value5 │
+└──────┴────────┘
+-------
+value1 value3 value5
+
+$ echo value1 value3 value6
+┌──────┬────────┐
+│ │ Values │
+├──────┼────────┤
+│ arg1 │ value1 │
+│ arg2 │ value3 │
+│ arg3 │ value6 │
+└──────┴────────┘
+-------
+value1 value3 value6
+
+[...]
+```
+
More examples can be found within the [**`/examples`**](./examples) folder.
"-i, --input <string>",
"JSON file with command and arguments to execute",
)
+ .option(
+ "--show-command",
+ "log input command",
+ )
.option(
"--show-args",
- "log input arguments along with the input command",
+ "log input arguments",
);
program.parse();
const options = program.opts();
}) as unknown as TemplateStringsArray;
if (args === undefined) {
- console.log(`\n$ ${command}`);
+ if (options.showCommand) {
+ console.log(`\n$ ${command}`);
+ }
await $(c);
} else {
const runs = getCombinations(args);
for (const [key, value] of Object.entries(inputArgs)) {
input = input.replaceAll(`$${key}`, value);
}
- console.log(`\n$ ${input}`);
+ if (options.showCommand) {
+ console.log(`\n$ ${input}`);
+ }
if (options.showArgs) {
console.table(inputArgs);
console.log("-------");