ZSH arguments-fu

Written on 18 mar 2010 and tagged development, subversion, zsh

When using Subversion from the command-line I commonly do:

svn copy ^/myproject/branches/FB-branch1 \
         ^/myproject/branches/FB-branch2
svn switch ^/myproject/branches/FB-branch2

This is a lot of typing. One way of working around this a wrapper around svn to automate these patterns, but another is using shell power. I use zsh, but bash and others can do the same with slightly different syntax:

svn copy ^/myproject/branches/FB-branch1 \
         ^/myproject/branches/FB-branch2
svn switch !!:3

Here !!:3 is the third argument of the last command. Neat!

You cannot leave comments on my site, but you can always tweet questions or comments at me: @avdgaag.