gwqadd 0.3.2 → 0.3.3

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.
Files changed (2) hide show
  1. package/bin/gwqadd.mjs +33 -0
  2. package/package.json +1 -1
package/bin/gwqadd.mjs CHANGED
@@ -266,6 +266,18 @@ __${slug}_exec() {
266
266
  # ${desc}.
267
267
  ${fnName}() {
268
268
  emulate -L zsh
269
+ # These print to stdout for the caller — help text, a list, JSON — and one of
270
+ # them, --json, would collide with the --quiet added below. Capturing that and
271
+ # handing it to cd produced "file name too long" on --help. Pass them through.
272
+ local __a
273
+ for __a in "$@"; do
274
+ case $__a in
275
+ -h|--help|-V|--version|--init|--init=*|--json)
276
+ __${slug}_exec "$@"
277
+ return $?
278
+ ;;
279
+ esac
280
+ done
269
281
  local __dir
270
282
  __dir=$(__${slug}_exec --quiet "$@") || return $?
271
283
  # Empty is not a failure: --no-cd, --help and --version all succeed without
@@ -296,6 +308,18 @@ __${slug}_exec() {
296
308
 
297
309
  # ${desc}.
298
310
  ${fnName}() {
311
+ # These print to stdout for the caller — help text, a list, JSON — and one of
312
+ # them, --json, would collide with the --quiet added below. Capturing that and
313
+ # handing it to cd produced "file name too long" on --help. Pass them through.
314
+ local __a
315
+ for __a in "$@"; do
316
+ case "$__a" in
317
+ -h|--help|-V|--version|--init|--init=*|--json)
318
+ __${slug}_exec "$@"
319
+ return $?
320
+ ;;
321
+ esac
322
+ done
299
323
  local __dir
300
324
  __dir=$(__${slug}_exec --quiet "$@") || return $?
301
325
  [ -n "$__dir" ] || return 0
@@ -322,6 +346,15 @@ function __${slug}_exec
322
346
  end
323
347
 
324
348
  function ${fnName} --description ${fishq(desc)}
349
+ # Help text, a list or JSON goes to the caller, not to cd. --json would also
350
+ # collide with the --quiet added below.
351
+ for __a in $argv
352
+ switch $__a
353
+ case -h --help -V --version --init '--init=*' --json
354
+ __${slug}_exec $argv
355
+ return $status
356
+ end
357
+ end
325
358
  set -l __dir (__${slug}_exec --quiet $argv)
326
359
  # \`set\` reports the command substitution's status, but not every fish
327
360
  # release agrees on that. Capturing it keeps a failed run from cd'ing,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gwqadd",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Create a branch and its gwq worktree in the repository you are in, and cd there.",
5
5
  "type": "module",
6
6
  "bin": {