Created
March 29, 2011 13:43
-
-
Save khamer/892379 to your computer and use it in GitHub Desktop.
First pass at creating a bash script to overload additional commands onto svn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| B="\033[1;7;32m" | |
| R="\033[0m" | |
| COMMAND="$0" | |
| COMMAND=${COMMAND##*/} | |
| ORIGINAL="$(which -a $COMMAND | grep -vE "^$0$" | head -1)" | |
| case $1 in | |
| '') | |
| echo -e "${B}svn is overloaded.$R" | |
| $ORIGINAL | |
| ;; | |
| help) | |
| case $2 in | |
| '') | |
| $ORIGINAL help | |
| echo -e "${B}Overloaded subcommands available:$R" | |
| echo -e " mass" | |
| echo -e " sw" | |
| ;; | |
| mass) | |
| svn-mass help | |
| ;; | |
| sw) | |
| switch -h | |
| ;; | |
| *) | |
| $ORIGINAL $@ | |
| ;; | |
| esac | |
| ;; | |
| mass) | |
| shift | |
| svn-mass $@ | |
| ;; | |
| sw) | |
| shift | |
| switch $@ | |
| ;; | |
| *) | |
| $ORIGINAL $@ | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment