zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _object_files: trailing version number for *.so is optional
@ 2017-12-18 12:03 Jun T
  0 siblings, 0 replies; only message in thread
From: Jun T @ 2017-12-18 12:03 UTC (permalink / raw)
  To: zsh-workers

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,)'


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-18 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 12:03 [PATCH] _object_files: trailing version number for *.so is optional Jun T

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).