Skip to content

Commit b4fb473

Browse files
committed
refactor(strings): scrape --encoding/-e args from --help output
1 parent 15409de commit b4fb473

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

completions/strings

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ _strings()
2121
return
2222
;;
2323
--encoding | -!(-*)e)
24-
COMPREPLY=($(compgen -W 's S b l B L' -- "$cur"))
24+
COMPREPLY=($(
25+
IFS=, compgen -W \
26+
'$(LC_ALL=C "$1" --help 2>/dev/null | \
27+
command sed -ne "s/.*--encoding={\([^}]*\)}.*/\1/p")' \
28+
-- "$cur"
29+
))
2530
return
2631
;;
2732
esac

0 commit comments

Comments
 (0)