Jan Lieskovsky
2013-May-19  13:23 UTC
[Libguestfs] [PATCH 1/1] guestfish: Tab-complete single / double quoted filenames containing space -- add fish_completion_word_break_characters_hook
This patch introduces fish_completion_word_break_characters_hook -
Readline's
rl_completion_word_break_hook for guestfish so tab-completion on / for single /
double quoted filenames containing space would be possible too - this covers
part:
  "In addition:
  ><fs> ls "/Program Files/<tab>
    doesn't show any files to complete."
from RH BZ#547488.
Thank you, Jan.
--
Jan iankko Lieskovsky
P.S.: Feel free to remove the comment lines, if you find them unnecessary.
P.S.#2: Have got a patch for completion of unquoted filenames containing space
        too already, but need to give it further testing => will submit in
        separated post later.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002_add_fish_completion_word_break_characters_hook.patch
Type: text/x-patch
Size: 2516 bytes
Desc: not available
URL:
<http://listman.redhat.com/archives/libguestfs/attachments/20130519/82e6d0cc/attachment.bin>
Richard W.M. Jones
2013-May-20  09:18 UTC
[Libguestfs] [PATCH 1/1] guestfish: Tab-complete single / double quoted filenames containing space -- add fish_completion_word_break_characters_hook
On Sun, May 19, 2013 at 09:23:59AM -0400, Jan Lieskovsky wrote:> +/* Readline word break hook for (guest)fish > + * Exclude space from the set of word break characters if Readline's buffer > + * contains path and some of possible tab-completions includes space. > + * Return basic / default set of word break characters otherwise > + */ > +char * > +fish_completion_word_break_characters (void)This function should be declared static. I tried these patches but they don't quite work for me:><fs> ll "/Program<TAB><TAB>gives:><fs> ll "/Program Files"/libguestfs: error: readdir: opendir: /Program Files": No such file or directory It seems to be including a rogue quote in the filename. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#)