about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-11-24 09:16:40 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-11-24 09:16:40 +0000
commitd47847c5f5c89f2ce4cfe53857086ce0f0037c8f (patch)
treee383411d429a405378a27c6f14a7cde1c3ca87f4
parentb0602dc5b410c97feaba51c6ea3c90322050dc54 (diff)
downloadzsh-d47847c5f5c89f2ce4cfe53857086ce0f0037c8f.tar.gz
zsh-d47847c5f5c89f2ce4cfe53857086ce0f0037c8f.tar.xz
zsh-d47847c5f5c89f2ce4cfe53857086ce0f0037c8f.zip
29915: new nm completion
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_nm29
3 files changed, 36 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e29cd0730..3645503f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-24  Peter Stephenson  <pws@csr.com>
+
+	* 29915: Completion/Unix/Command/.distfiles,
+	Completion/Unix/Command/_nm: new nm completion.
+
 2011-11-23  Peter Stephenson  <pws@csr.com>
 
 	* Ignacy Gawędzki: 29912: Completion/Unix/Command/_ssh: add "--"
@@ -15604,5 +15609,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5504 $
+* $Revision: 1.5505 $
 *****************************************************
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 22e0a4fbe..a89b7d923 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -141,6 +141,7 @@ _mysqldiff
 _ncftp
 _netcat
 _nice
+_nm
 _nmap
 _notmuch
 _npm
diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm
new file mode 100644
index 000000000..276a38f19
--- /dev/null
+++ b/Completion/Unix/Command/_nm
@@ -0,0 +1,29 @@
+#compdef nm
+
+# This is a stub.  It's main reason for existence is to offer
+# object files with nm.  Feel free to extend it.  If you do, remove
+# this comment.
+
+local state context line expl
+local -A opt_args
+local -a args
+integer ret=1
+
+if _pick_variant gnu='Free Soft' unix --version; then
+  args+=(-s --)
+fi
+args+=('*:file:->file')
+
+_arguments "$args[@]" && ret=0
+
+case $state in
+  (file)
+  _alternative \
+    "object-files:object file:_path_files -g '*.o'" \
+    "executable-files:executable file:_path_files -g '*(*)'" \
+    "dynamic-libraries:dynamic library:_path_files -g '*.so'" \
+    "static-libraries:static library:_path_files -g '*.a'" && ret=0
+  ;;
+esac
+
+return ret