Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] _object_files: trailing version number for *.so is optional



I've noticed that
zsh% objdump <TAB>
does not complete any object files (*.o) which do not have execute permission.
This is due to the '##' in the condition
$REPLY = *.([ao]|so|elf)(.<->)##
in _object_files.
The trailing version number (.<->) is not required but optional.

In the patch below, I allowed the version number only for *.so.


diff --git a/Completion/Unix/Type/_object_files b/Completion/Unix/Type/_object_files
index 31a13aefc..70b5b6688 100644
--- a/Completion/Unix/Type/_object_files
+++ b/Completion/Unix/Type/_object_files
@@ -5,7 +5,8 @@ local expl
 _description files expl 'object file'
 
 __object_file() {
-  [[ -x $REPLY || $REPLY = *.([ao]|so|elf)(.<->)## || $REPLY = (core*|*.core) ]]
+  [[ -x $REPLY || $REPLY = *.(a|o|elf) || $REPLY = *.so(.<->)# ||
+	$REPLY = (core*|*.core) ]]
 }
 
 _files -g '*(-.e,__object_file,)'



Messages sorted by: Reverse Date, Date, Thread, Author