just-bash-util 0.1.7 → 0.1.8
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 +10 -4
- package/dist/{chunk-B6JJTTPV.js → chunk-4EGDYWA4.js} +0 -1
- package/dist/command/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ await serve.invoke({ port: 8080, entry: "app.ts" }, ctx);
|
|
|
64
64
|
- `omitInherited` to exclude parent options from specific subcommands
|
|
65
65
|
- `--help` / `-h` auto-generated at every level
|
|
66
66
|
- `--no-<flag>` negation, `-abc` combined short flags, `--key=value` syntax, counted flags (`-vvv` → 3)
|
|
67
|
-
- `--` end-of-options separator (remaining tokens
|
|
67
|
+
- `--` end-of-options separator (remaining tokens go to `meta.passthrough` without consuming positional args)
|
|
68
68
|
- Environment variable fallbacks for options
|
|
69
69
|
- Levenshtein-based "did you mean?" suggestions for typos
|
|
70
70
|
- `transformArgs` callback to rewrite tokens before parsing — support non-standard shorthand syntax like `-5` → `-n 5`
|
|
@@ -114,13 +114,19 @@ args: [
|
|
|
114
114
|
|
|
115
115
|
#### The `--` separator
|
|
116
116
|
|
|
117
|
-
The `--` token
|
|
117
|
+
The `--` token stops all parsing. Tokens after `--` go exclusively into `meta.passthrough` — they are **not** consumed as positional args or parsed as flags. Positional args must appear before `--`:
|
|
118
118
|
|
|
119
119
|
```ts
|
|
120
|
+
// mycli checkout main -- README.md
|
|
121
|
+
handler: (args, ctx, meta) => {
|
|
122
|
+
args.target; // "main" (positional arg before --)
|
|
123
|
+
meta.passthrough; // ["README.md"] (tokens after --)
|
|
124
|
+
}
|
|
125
|
+
|
|
120
126
|
// mycli checkout -- README.md
|
|
121
127
|
handler: (args, ctx, meta) => {
|
|
122
|
-
args.target; //
|
|
123
|
-
meta.passthrough; // ["README.md"]
|
|
128
|
+
args.target; // undefined (no positional before --)
|
|
129
|
+
meta.passthrough; // ["README.md"]
|
|
124
130
|
}
|
|
125
131
|
```
|
|
126
132
|
|
package/dist/command/index.js
CHANGED
package/dist/index.js
CHANGED