diff options
Diffstat (limited to 'completions/java')
-rw-r--r-- | completions/java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/completions/java b/completions/java index 3ca65869..89d207d2 100644 --- a/completions/java +++ b/completions/java @@ -64,7 +64,12 @@ _java_classes() if type zipinfo &>/dev/null; then COMPREPLY+=( $(zipinfo -1 "$i" "$cur*" 2>/dev/null | \ command grep '^[^$]*\.class$') ) - else + elif type unzip &>/dev/null; then + # Last column, between entries consisting entirely of dashes + COMPREPLY+=( $(unzip -lq "$i" "$cur*" 2>/dev/null | \ + awk '$NF ~ /^-+$/ { flag=!flag; next }; + flag && $NF ~ /^[^$]*\.class/ { print $NF }') ) + elif type jar &>/dev/null; then COMPREPLY+=( $(jar tf "$i" "$cur" | \ command grep '^[^$]*\.class$') ) fi |