Skip to content

Instantly share code, notes, and snippets.

@khamer
Created March 29, 2011 13:43
Show Gist options
  • Select an option

  • Save khamer/892379 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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