# HG changeset patch # User Jeff Hammel # Date 1375682392 25200 # Node ID 5bee5c55a7a0f4d4ecbac2798bb6e09bb6fc59af # Parent 9d6e7a471fc70fb966a0e9c5899fe2145d2cb68a args test + bash overrides hg safety diff -r 9d6e7a471fc7 -r 5bee5c55a7a0 .bash_overrides --- a/.bash_overrides Sun Aug 04 15:58:31 2013 -0700 +++ b/.bash_overrides Sun Aug 04 22:59:52 2013 -0700 @@ -97,6 +97,21 @@ `which find` -L "$DIR" -not -path '*.svn*' "$@" } +function hg { + if [[ "$(hg root)" == "${HOME}" ]] + then + if [[ "$*" == st* ]] + then + command hg st -q + return + fi + if [[ "$*" == res* ]] || [[ "$*" == pu* ]] + then + echo "Aborting \'hg $*\'; hg root is ${HOME}!" + fi + fi +} + function lsdiff { # TODO: extract this general pattern as a bash "decorator" if expr "$1" : 'http[s]\?://.*' &> /dev/null diff -r 9d6e7a471fc7 -r 5bee5c55a7a0 bin/example/args.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/example/args.sh Sun Aug 04 22:59:52 2013 -0700 @@ -0,0 +1,17 @@ +#!/bin/bash + +function foo { + echo '$*'="$*" + echo '$@'="$@" + echo '$#'="$#" + if [[ "$*" == "test string" ]] + then + echo '$*' == "test string" + if [[ "$@" == "test string" ]] + then + echo '$@' == "test string" + else + echo '$@' != "test string" + fi + fi +} \ No newline at end of file