feature request

Wayne Davison wayned at samba.org
Sun Mar 6 06:48:38 GMT 2005


On Sat, Mar 05, 2005 at 05:54:28PM -0800, Frederik Eaton wrote:
> It breaks some functionality of the
> --include and --exclude options:

True.  You can work around that problem if you always use an '=' to
connect the option to its arg by adding a new match to the case in that
function:

    --exclude=*|--include=*|--filter=*) ;;

That will allow you to specify "--include=foo/" without the slash
getting stripped.  (And, if you wanted to, you could extend the script
to understand the non-equal version of those options too, but it would
need a more complicated parsing loop).

> However, you haven't given your reasons for not wanting to include
> the proposed option. I'm curious.

#1: I don't really like the idea -- a trailing slash has a particular
meaning to rsync, and I don't like the idea of complicating it by
adding an option.  #2: it's the sort of thing a shell is good at
solving, so I think that is the appropriate place to customize this.

Aside:  I'll mention one other thing that can help with trailing
slashes in general, and that is the Z-shell.  It has the ability to
auto-remove auto-added characters depending on what you type.  For
instance, if you typed "rsync -av long-<TAB>" and it completed the
directory name to "long-named-dir/", if you then typed a space to move
on to the destination name, zsh would auto-remove the slash (it would
leave it if you started typing a name within the dir or if you
explicitly typed a slash).  It does the same sort of thing with other
auto-added characters, such as a ':' that appears when completing a
user-name following the chown command (just in case you want to add a
group) and quite a few others.  Just FYI -- switching shells may not be
an option, but I thought I'd mention it because not everyone knows that
zsh has this feature.

..wayne..


More information about the rsync mailing list