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



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