From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24119 invoked by alias); 23 Nov 2011 18:20:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29915 Received: (qmail 20863 invoked from network); 23 Nov 2011 18:20:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Wed, 23 Nov 2011 17:45:19 +0000 From: Peter Stephenson To: "Zsh Hackers' List" Subject: PATCH: nm completion Message-ID: <20111123174519.04b2dabc@pwslap01u.europe.root.pri> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.101.11.233] X-Scanned-By: MailControl 7.6.4 (www.mailcontrol.com) on 10.68.0.162 Not sure why this wasn't done ages ago, and I keep tripping over the non-completion of .o files in my configuration, and have done for many, many years. This is just a stub, but if you're using GNU nm it gets you a pretty long way. Index: Completion/Unix/Command/.distfiles =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/.distfiles,v retrieving revision 1.122 diff -p -u -r1.122 .distfiles --- Completion/Unix/Command/.distfiles 20 Aug 2011 07:44:41 -0000 1.122 +++ Completion/Unix/Command/.distfiles 23 Nov 2011 17:40:47 -0000 @@ -141,6 +141,7 @@ _mysqldiff _ncftp _netcat _nice +_nm _nmap _notmuch _npm Index: Completion/Unix/Command/_nm =================================================================== RCS file: Completion/Unix/Command/_nm diff -N Completion/Unix/Command/_nm --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_nm 23 Nov 2011 17:40:47 -0000 @@ -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 -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog