From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26657 invoked by alias); 16 Apr 2013 06:56:14 -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: 31265 Received: (qmail 5808 invoked from network); 16 Apr 2013 06:56:01 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at chaosdorf.de does not designate permitted sender hosts) Date: Tue, 16 Apr 2013 08:47:54 +0200 From: Daniel Friesel To: zsh-workers@zsh.org Subject: [PATCH] devtodo completion: respect --sort option Message-ID: <20130416064754.GA24505@derf.homelinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bKyqfOwhbdpXa4YI" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --bKyqfOwhbdpXa4YI Content-Type: multipart/mixed; boundary="DKU6Jbt7q3WqK7+M" Content-Disposition: inline --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, this patch makes _devtodo behave correctly when using devtodo --sort. --Daniel --DKU6Jbt7q3WqK7+M Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-devtodo-completion-respect-sort-option.patch" Content-Transfer-Encoding: quoted-printable =46rom b05fa9317e6041978605c54c92a50fea749033fa Mon Sep 17 00:00:00 2001 =46rom: Daniel Friesel Date: Tue, 16 Apr 2013 08:39:17 +0200 Subject: [PATCH] devtodo completion: respect --sort option The --sort option changes the mapping between indices and entries, so when completing indices while showing the entries as help we need to respect it. --- Completion/Unix/Command/_devtodo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Completion/Unix/Command/_devtodo b/Completion/Unix/Command/_de= vtodo index 06fc675..2800f4a 100644 --- a/Completion/Unix/Command/_devtodo +++ b/Completion/Unix/Command/_devtodo @@ -8,9 +8,11 @@ typeset -i i typeset expl =20 for ((i=3D2; i <=3D $#words; i++)) { - if [[ $words[$i] =3D=3D '--database' ]] { + if [[ $words[$i] =3D=3D '--database' ]]; then todo_opts+=3D(--database ${~words[$((++i))]}) - } + elif [[ $words[$i] =3D=3D '--sort' ]]; then + todo_opts+=3D(--sort ${words[$((++i))]}) + fi } =20 priorities=3D(verylow low medium high veryhigh) --=20 1.7.10.4 --DKU6Jbt7q3WqK7+M-- --bKyqfOwhbdpXa4YI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJRbPQZAAoJEBANW/tRZuAFt5AP/RuItC+2e3Ifjt+FCy3PkdI5 n2SAYS//SdfmlRpP66bXR0t+lkJcGkAg/U4YA/czYnH0CEKeOn6y7dKKPd3LwWt/ gw8+uDpPSOkGYBRgfBTMUfnltOuDMtJ9gEOsodVcHR6D1tPBM+flfX7jLa87e0hN GbSsNi+KxQw6m0lTWzjejhzcOiHvx3EzAybrMpql+CqcO1lTAcVHT7o4vfKkyfYZ X5qu3o2nVVp/LfJ38AOhIa/VRgS1yGTu6oJP0dMPJdbacaIBwf8Yo5cc/VhjkoZe iEiX4VL0JKULjiPnz7BBIWIQNKU8bE547JXG+fdYol0+Wt067y7XmJCa2xYjj30Z iFZY6xIjZdA+cJLcyxm1uW1JNRUVUEgej5rJo/V0F5cdLYIKLilwoPplG7qqNOKb AoJ/liWX9fZiT6ONsYShr1iAqAKkPCWPRLRV9P74+1u1m/jMfzREQzHLWxu48knt ylZNJxNCWAFUr7CopBlW82oDmM3KVByeLoXFI90pprItsz+IbrAMQFTkIrnk+s46 d6KFc//XTzoHa9Z2y9+3jeWIzgMKXJlTdjeAhaVd7PIBmhCgnqLzYQaohKjzbP4B otn/xW4qga1NOVN0E+6R6mQbg1vv6hhJ9WuuOfq38+xeGaAFSOS1AWdUs7E5emNw tpzaSl7xERns0YE2m9Au =905o -----END PGP SIGNATURE----- --bKyqfOwhbdpXa4YI--