@optique/core 1.0.1 → 1.0.2
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/dist/completion.cjs +23 -9
- package/dist/completion.js +23 -9
- package/package.json +1 -1
package/dist/completion.cjs
CHANGED
|
@@ -382,13 +382,25 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
382
382
|
fi
|
|
383
383
|
fi
|
|
384
384
|
|
|
385
|
+
local ext_pattern=""
|
|
386
|
+
if [[ -n "\$extensions" ]]; then
|
|
387
|
+
if [[ "\$extensions" == *,* ]]; then
|
|
388
|
+
ext_pattern="*.(\${extensions//,/|})"
|
|
389
|
+
else
|
|
390
|
+
ext_pattern="*.\$extensions"
|
|
391
|
+
fi
|
|
392
|
+
fi
|
|
385
393
|
# Use zsh's native file completion
|
|
386
394
|
case "\$type" in
|
|
387
395
|
file)
|
|
388
|
-
if [[ -n "\$
|
|
389
|
-
#
|
|
390
|
-
|
|
391
|
-
_files -
|
|
396
|
+
if [[ -n "\$ext_pattern" ]]; then
|
|
397
|
+
# Route filtered files through zsh's standard files/directories
|
|
398
|
+
# tags so files-tag styles and tag-order still apply, while
|
|
399
|
+
# avoiding _files' all-files fallback for extension-filtered
|
|
400
|
+
# matches.
|
|
401
|
+
local file_pattern="\${ext_pattern}(#q-.)"
|
|
402
|
+
_wanted files expl file _path_files -g "\${file_pattern}"
|
|
403
|
+
_wanted directories expl directory _path_files -/
|
|
392
404
|
else
|
|
393
405
|
_files
|
|
394
406
|
fi
|
|
@@ -397,10 +409,10 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
397
409
|
_directories
|
|
398
410
|
;;
|
|
399
411
|
any)
|
|
400
|
-
if [[ -n "\$
|
|
401
|
-
#
|
|
402
|
-
|
|
403
|
-
|
|
412
|
+
if [[ -n "\$ext_pattern" ]]; then
|
|
413
|
+
local file_pattern="\${ext_pattern}(#q^-/)"
|
|
414
|
+
_wanted files expl file _path_files -g "\${file_pattern}"
|
|
415
|
+
_wanted directories expl directory _path_files -/
|
|
404
416
|
else
|
|
405
417
|
_files
|
|
406
418
|
fi
|
|
@@ -437,7 +449,9 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
437
449
|
fi
|
|
438
450
|
}
|
|
439
451
|
|
|
440
|
-
|
|
452
|
+
if (( $+functions[compdef] )); then
|
|
453
|
+
compdef _${programName.replace(/[^a-zA-Z0-9]/g, "_")} ${programName}
|
|
454
|
+
fi
|
|
441
455
|
`;
|
|
442
456
|
},
|
|
443
457
|
*encodeSuggestions(suggestions) {
|
package/dist/completion.js
CHANGED
|
@@ -382,13 +382,25 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
382
382
|
fi
|
|
383
383
|
fi
|
|
384
384
|
|
|
385
|
+
local ext_pattern=""
|
|
386
|
+
if [[ -n "\$extensions" ]]; then
|
|
387
|
+
if [[ "\$extensions" == *,* ]]; then
|
|
388
|
+
ext_pattern="*.(\${extensions//,/|})"
|
|
389
|
+
else
|
|
390
|
+
ext_pattern="*.\$extensions"
|
|
391
|
+
fi
|
|
392
|
+
fi
|
|
385
393
|
# Use zsh's native file completion
|
|
386
394
|
case "\$type" in
|
|
387
395
|
file)
|
|
388
|
-
if [[ -n "\$
|
|
389
|
-
#
|
|
390
|
-
|
|
391
|
-
_files -
|
|
396
|
+
if [[ -n "\$ext_pattern" ]]; then
|
|
397
|
+
# Route filtered files through zsh's standard files/directories
|
|
398
|
+
# tags so files-tag styles and tag-order still apply, while
|
|
399
|
+
# avoiding _files' all-files fallback for extension-filtered
|
|
400
|
+
# matches.
|
|
401
|
+
local file_pattern="\${ext_pattern}(#q-.)"
|
|
402
|
+
_wanted files expl file _path_files -g "\${file_pattern}"
|
|
403
|
+
_wanted directories expl directory _path_files -/
|
|
392
404
|
else
|
|
393
405
|
_files
|
|
394
406
|
fi
|
|
@@ -397,10 +409,10 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
397
409
|
_directories
|
|
398
410
|
;;
|
|
399
411
|
any)
|
|
400
|
-
if [[ -n "\$
|
|
401
|
-
#
|
|
402
|
-
|
|
403
|
-
|
|
412
|
+
if [[ -n "\$ext_pattern" ]]; then
|
|
413
|
+
local file_pattern="\${ext_pattern}(#q^-/)"
|
|
414
|
+
_wanted files expl file _path_files -g "\${file_pattern}"
|
|
415
|
+
_wanted directories expl directory _path_files -/
|
|
404
416
|
else
|
|
405
417
|
_files
|
|
406
418
|
fi
|
|
@@ -437,7 +449,9 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
|
|
|
437
449
|
fi
|
|
438
450
|
}
|
|
439
451
|
|
|
440
|
-
|
|
452
|
+
if (( $+functions[compdef] )); then
|
|
453
|
+
compdef _${programName.replace(/[^a-zA-Z0-9]/g, "_")} ${programName}
|
|
454
|
+
fi
|
|
441
455
|
`;
|
|
442
456
|
},
|
|
443
457
|
*encodeSuggestions(suggestions) {
|