summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-09-10 23:11:02 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-09-10 23:16:03 +0200
commitb4681a15590bc240295e4569e39d13dffde1bb44 (patch)
treee541c0be6095f5f0f08baa7ed664ec15af840523
parentd371b913dc17780dbfa9985bd22caaa01b05dda2 (diff)
downloaddotfiles-b4681a15590bc240295e4569e39d13dffde1bb44.tar.gz
dotfiles-b4681a15590bc240295e4569e39d13dffde1bb44.tar.xz
dotfiles-b4681a15590bc240295e4569e39d13dffde1bb44.zip
Bash config: refactor common "echo usage $FUNCNAME" as alias
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc9
1 files changed, 5 insertions, 4 deletions
diff --git a/.bashrc b/.bashrc
index 9114e30..eb33561 100644
--- a/.bashrc
+++ b/.bashrc
@@ -30,15 +30,16 @@ alias mc='LESS="-RSX" mc'
alias tmux='tmux -2'
alias acka='ack -a --follow'
-# debug, etc.
+# internal, debug, etc.
alias hist-del-last='history -d $(history 1 | cut -d" " -f2)' # historical NOOP
+alias int-usage='echo "usage: $FUNCNAME "'
# dir aliases (use either as "gmy" or "cd $(gmy)" or, e.g., "gmy dotfiles")
diralias ~/wrkspc/gmy
diralias ~/wrkspc/gwork
-# debug, etc.
+# internal, debug, etc.
debug-argsep () {
while [ $# -ne 0 ]; do
@@ -69,7 +70,7 @@ sec-wx-mem () {
}
ack-intersection () {
- [ $# -ne 2 ] && echo "usage: $FUNCNAME 1st-regexp 2nd-regexp" && return
+ [ $# -ne 2 ] && int-usage "1st-regexp" "2nd-regexp" && return
comm <(ack -al --follow "$1" | sort) <(ack -al --follow "$2" | sort) -12
}
@@ -79,7 +80,7 @@ hist-grep () {
}
img-diff () {
- [ $# -ne 2 ] && echo "usage: $FUNCNAME 1st-img 2nd-img" && return
+ [ $# -ne 2 ] && int-usage "1st-img" "2nd-img" && return
#xloadimage <(gm compare "$1" "$2" -highlight-color red -highlight-style threshold -file -)
#xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray -compose threshold -)
#xloadimage <(compare "$1" "$2" -highlight-color violet -lowlight-color darkgray \