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 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 become positional args and are available via `meta.passthrough`)
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 signals end-of-options. Tokens after `--` are treated as positional arguments (not parsed as flags) and are also available in `meta.passthrough`:
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; // "README.md" (assigned to positional arg)
123
- meta.passthrough; // ["README.md"] (raw tokens after --)
128
+ args.target; // undefined (no positional before --)
129
+ meta.passthrough; // ["README.md"]
124
130
  }
125
131
  ```
126
132
 
@@ -217,7 +217,6 @@ function parseArgs(options, argDefs, tokens, env) {
217
217
  if (token === "--") {
218
218
  i++;
219
219
  while (i < tokens.length) {
220
- positionals.push(tokens[i]);
221
220
  passthrough.push(tokens[i]);
222
221
  i++;
223
222
  }
@@ -8,7 +8,7 @@ import {
8
8
  generateHelp,
9
9
  o,
10
10
  parseArgs
11
- } from "../chunk-B6JJTTPV.js";
11
+ } from "../chunk-4EGDYWA4.js";
12
12
  export {
13
13
  Command,
14
14
  a,
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  generateHelp,
9
9
  o,
10
10
  parseArgs
11
- } from "./chunk-B6JJTTPV.js";
11
+ } from "./chunk-4EGDYWA4.js";
12
12
  import {
13
13
  findUp,
14
14
  loadConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-bash-util",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "CLI command framework, config file discovery, and path utilities for just-bash",
5
5
  "type": "module",
6
6
  "license": "MIT",