summaryrefslogtreecommitdiff
path: root/completions/java
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
commit019f3cc463db63abc6460f97deb488deec43840b (patch)
tree08cd5387d6c8af6f688d6468c7e2ae9f25c449be /completions/java
parent5732da2af736c40cf693354485446ab4867ecb4d (diff)
downloadbash-completion-019f3cc463db63abc6460f97deb488deec43840b.tar.gz
New upstream version 2.10upstream/2.10
Diffstat (limited to 'completions/java')
-rw-r--r--completions/java7
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