Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
- X-seq: zsh-workers 39164
- From: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
- Date: Fri, 2 Sep 2016 23:02:57 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=68FrQhO8u0yxCU+ISDJf9G+EsjOqqbhDJkuvalTkoHc=; b=lGjVrGe1tl//Rj0OVmIa3cIDxHgPhGZRunM1HCUvl1BPpXnYLkfPK4tyE5DU+UFtQ5 uqwgNQSj5Rl157uuqtn4DRk8qz5lMhcMaVTg5ScL6BnyeTjqTqxKFVVyANPE0yEB2O+l Xf8vyjfrAkIn3L1eAbWwmunlX3hOWZ6lmPB7mt4ZvGhajKulY4iqyrWDH62XUmTbbxNi Ath+exmB2m6GqixNURCKjcWFbl55R5HQatxel7aK+t0rme/2Bd0HU3EBizWadh4w2Pz0 eNUfpRkhjVGlTP0dXWq1+D1K5407n3NFOFf6ofsuSqR7/bxZdtNKEFh6yE2XsvH//WtB jEcw==
- In-reply-to: <160901182720.ZM6370@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20160830232332.GA23779@zira.vinc17.org> <20160831030055.GC30557@fujitsu.shahaf.local2> <854eeb20-f9b9-f918-4739-82597bbccb1a@googlemail.com> <160901182720.ZM6370@torch.brasslantern.com>
On 02.09.2016 03:27, Bart Schaefer wrote:
> On Aug 31, 10:27pm, m0viefreak wrote:
> }
> } On 31.08.2016 05:00, Daniel Shahaf wrote:
> } > I think that's the best we can do without writing new C code to suport
> } > multiline descriptions.
> }
> } This has been working well for me:
> }
> } zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n #/ }"'
>
> If that works, then we ought to be able to rewrite the loop starting
> at about line 91 of _arguments. But that loop already seems to be
> looking for lines with leading spaces, whereas if I'm reading your
> pattern correctly you're unfolding lines with more than six leading
> spaces to make them part of the previous line?
>
> I have to update that to look for more than eight spaces for it to work
> right for zsh's ./configure
Oh, right, I'm missing one #. It should have been '[8spaces]##':
zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n ##/ }"'
> and even then it mysteriously fails to pick
> out defaults [/usr/local] and [PREFIX] for --prefix and --exec-prefix
> respectively, though it gets it right for --datarootdir et al.
This works fine for me:
~/sources/zsh $ ./configure --e<TAB>
Completing: option
--enable-additional-fpath -- add directories to default function path
--enable-ansi2knr -- translate source to K&R C before compiling
--enable-cap -- enable the search for POSIX capabilities (may require additional headers to be added by hand)
--enable-cflags -- specify C compiler flags
--enable-cppflags -- specify C preprocessor flags
--enable-custom-patchlevel -- set a custom ZSH_PATCHLEVEL value
--enable-etcdir -- the default directory for global zsh scripts
--enable-fndir -- the directory in which to install functions
--enable-function-subdirs -- install functions in subdirectories
--enable-ldflags -- specify linker flags
--enable-libc-musl -- compile with musl as the C library
--enable-libs -- specify link libraries
--enable-maildir-support -- enable maildir support in MAIL and MAILPATH
--enable-max-function-depth -- limit function depth to MAX, default 1000
--enable-multibyte -- support multibyte characters
--enable-pcre -- enable the search for the pcre library (may create run-time library dependencies)
--enable-readnullcmd -- pager used when READNULLCMD is not set
--enable-runhelpdir -- the directory in which to install run-help files
--enable-scriptdir -- the directory in which to install scripts
--enable-site-fndir -- same for site functions (not version specific)
--enable-site-scriptdir -- same for site scripts (not version specific)
--enable-stack-allocation -- allocate stack memory e.g. with `alloca'
--enable-zlogin -- the full pathname of the global zlogin script
--enable-zlogout -- the full pathname of the global zlogout script
--enable-zprofile -- the full pathname of the global zprofile script
--enable-zsh-debug -- compile with debug code and debugger symbols
--enable-zsh-hash-debug -- turn on debugging of internal hash tables
--enable-zsh-heap-debug -- turn on error checking for heap allocation
--enable-zsh-mem -- compile with zsh memory allocation routines
--enable-zsh-mem-debug -- debug zsh memory allocation routines
--enable-zsh-mem-warning -- print warnings for errors in memory allocation
--enable-zsh-secure-free -- turn on error checking for free()
--enable-zsh-valgrind -- turn on support for valgrind debugging of heap memory
--enable-zshenv -- the full pathname of the global zshenv script
--enable-zshrc -- the full pathname of the global zshrc script
--exec-prefix -- install architecture-dependent files in EPREFIX (PREFIX)
~/sources/zsh $ ./configure --p<TAB>
Completing: option
--pdfdir -- pdf documentation (DOCDIR)
--prefix -- install architecture-independent files in PREFIX (/usr/local)
--program-prefix -- prepend PREFIX to installed program names
--program-suffix -- append SUFFIX to installed program names
--program-transform-name -- run sed PROGRAM on installed program names
--psdir -- ps documentation (DOCDIR)
Also, slightly related:
The _configure completion could benefit from my patch I sent back in march:
http://www.zsh.org/mla/workers//2016/msg00674.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author