zsh-users
 help / color / mirror / code / Atom feed
* rsync hosts completion not working after aliased
@ 2009-04-06 14:58 sam.reckoner
  2009-04-06 15:48 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: sam.reckoner @ 2009-04-06 14:58 UTC (permalink / raw)
  To: zsh-users

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

Hi,

rsync completes hosts nicely until I define the following alias:

alias rsync='/bin/rsync -uavz --progress -e ssh --chmod=Dg-rx,Do-rx'

and then it doesn't complete anything, even files. I do _complete_help on  
this and it shows nothing.

Little help?

[-- Attachment #2: Type: text/html, Size: 307 bytes --]

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

* Re: rsync hosts completion not working after aliased
  2009-04-06 14:58 rsync hosts completion not working after aliased sam.reckoner
@ 2009-04-06 15:48 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2009-04-06 15:48 UTC (permalink / raw)
  To: zsh-users

On Apr 6,  2:58pm, sam.reckoner@gmail.com wrote:
} 
} alias rsync='/bin/rsync -uavz --progress -e ssh --chmod=Dg-rx,Do-rx'
} 
} and then it doesn't complete anything, even files. I do _complete_help on  
} this and it shows nothing.

I'm not sure why _complete_help shows nothing, but if you try instead to
complete the raw command you can get more details.

There are several problems with the _rsync completer (or that are being
demonstrated by the _rsync completer, anyway).  For example, if I first
do:

torch% rsync -<TAB>
Completing option
--8-bit-output         -8              -- leave high-bit chars unescaped in ou
--acls                 -A              -- preserve access-control lists
--address                              -- bind to the specified address
--append                               -- append data onto shorter files
(etc., scrolls off the page)

OK, I'm in menu selection, as I should be.  Mouse around a bit and choose
one of the options and hit enter:

torch% rsync --append 
zsh: do you wish to see all 408 possibilities (137 lines)? 

It's acting as though I hit TAB again.  How did we go straight into list
mode from menu-select?

Anyway, after being sidetracked by that for a bit, we come to the crux
of your problem, which is this:

torch% rsync --append --chmod=<TAB>
torch% rsync --append --chmod 
Completing corrections
--chmod                -- change destination permissions
Completing original
--chmod=

So the completion function hasn't been told that you can append the set
of modes [*] to the --chmod option with an equal sign, and it gets very
confused trying to find suggested completions for an option whose name
is "chmod=Dg-rx,Do-rx".

If you instead make it "--chmod Dg-rx,Do-rx" then completion proceeds
normally.

[*] The descriptive text for the argument following --chmod says that 
it expects "mods".  No; it expects "modes".  Unix programmers 25 years
ago were vowel-stingy in the name of having less to type.


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

end of thread, other threads:[~2009-04-06 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-06 14:58 rsync hosts completion not working after aliased sam.reckoner
2009-04-06 15:48 ` Bart Schaefer

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