zsh-workers
 help / color / mirror / code / Atom feed
From: m0viefreak <m0viefreak.cm@googlemail.com>
To: zsh-workers@zsh.org
Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
Date: Fri, 2 Sep 2016 23:02:57 +0200	[thread overview]
Message-ID: <f287f209-6f21-5122-255a-81834358b302@googlemail.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2016-09-02 22:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 23:23 buggy configure completion Vincent Lefevre
2016-08-31  3:00 ` buggy configure completion - when both --enable-foo and --disable-foo are listed Daniel Shahaf
2016-08-31  6:15   ` Vincent Lefevre
2016-08-31  9:09     ` Daniel Shahaf
2016-08-31 20:27   ` m0viefreak
2016-09-02  1:27     ` Bart Schaefer
2016-09-02 21:02       ` m0viefreak [this message]
2016-09-07  5:39         ` Bart Schaefer
2016-08-31  3:03 ` Daniel Shahaf
2016-08-31  6:45   ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f287f209-6f21-5122-255a-81834358b302@googlemail.com \
    --to=m0viefreak.cm@googlemail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).