[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

complete -p fails to properly quote argument to -C option

From: martin
Subject: complete -p fails to properly quote argument to -C option
Date: Fri, 13 Apr 2007 10:41:44 -0400

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux esau #1 PREEMPT Mon Aug 21 13:42:56 EDT 2006 i586 
Machine Type: i486-pc-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

        According to the manpage, "complete -p" output should be
        useable at the command line to recreate the same completion.
        However, if you have a completion using -C where -C is
        a command with an argument, the complete -p output is

        Imagine you have a local command called 'foo'.  Imagine
        that the legal arguments to foo can be determined by
        running another local command '/usr/local/bin/fooinfo -l'.
        (The '-l' option is necessary to get fooinfo to only list
        the available options, one at a time)
        Now, one reasonable completion entry would be:

        complete -C '/usr/local/bin/fooinfo -l' -X\!\&\* foo

        And this works.  Unfortunately, "complete -p" prints this

        complete -X '!&*' -C /usr/local/bin/fooinfo -l foo

        That is, no quotes around the argument to -C.  This means
        that the output of 'complete -p' cannot in this case be typed 
        back in at the command line, or directed into a file to
        be sourced by future sessions.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]