Skip to content

Commit

Permalink
bashrc refactored alias gv with case and 0 results branch
Browse files Browse the repository at this point in the history
  • Loading branch information
durdn committed Oct 24, 2012
1 parent 1f65ab2 commit 3c3280c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 10 additions & 7 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,16 @@ function gv {
for f in $search_result; do echo $search_count. $f;search_count=$(($search_count+1)); done

arr=($search_result)
if [ ${#arr[@]} -ne 1 ]; then
echo "enter file number:"
read fn
nohup $editor ${arr[fn-1]} 2>/dev/null &
else
nohup $editor ${search_result} 2>/dev/null &
fi
case "${#arr[@]}" in
0)
;;
1) nohup $editor ${search_result} 2>/dev/null &
;;
*) echo "enter file number:"
read fn
nohup $editor ${arr[fn-1]} 2>/dev/null &
;;
esac
}

# }}}
Expand Down
3 changes: 2 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
ai = add --interactive

co = checkout
br = "!git branch -ra | grep -v done"
br = branch
#"!git branch -ra | grep -v done"
bra = branch -ra
#list commands
le = log --oneline --decorate
Expand Down

0 comments on commit 3c3280c

Please sign in to comment.