zsh-users
 help / color / mirror / code / Atom feed
* safe completion functions
@ 2005-10-28 17:14 Steve Borho
  2005-10-28 17:29 ` Clint Adams
  2005-10-28 17:31 ` Andrey Borzenkov
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Borho @ 2005-10-28 17:14 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

Hello everyone.

I'm trying to write a somewhat feature-full completion function for the new 
bazaar 2.0 (aka bzr) revision control system.

The bzr developers have recently added some command line functions that can 
list files with NULL terminators, just like find.  Unfortunately, I can't get 
the completion functions to work correctly.

my completion function for add looks like this (in a nutshell):

  (add)
       _arguments $helpArgs \
       '--no-recurse[do not recurse into subdirectories]' \
       '(-q)--quiet' \
       '(--quiet)-q' \
       '*:unknown files:_unknownFiles'
  ;;

_unknownFiles() {
    local fileList;
    fileList=($(bzr ls --null --unknown))
    compadd -af fileList
    return 0
}

When I test it, I get: this

% cd repo
% touch "foo bar" baz zed
% bzr add [TAB]
     bar  baz  foo  zed

It's somehow splitting "foo\ bar" into "foo",  " ",  "bar".  I seem to be 
missing something obvious.  Can anyone help?

-- 
Steve Borho (steve@borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-28 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-28 17:14 safe completion functions Steve Borho
2005-10-28 17:29 ` Clint Adams
2005-10-28 18:06   ` Steve Borho
2005-10-28 17:31 ` Andrey Borzenkov

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).