aboutsummaryrefslogtreecommitdiff
path: root/g.sh
diff options
context:
space:
mode:
Diffstat (limited to 'g.sh')
-rw-r--r--g.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/g.sh b/g.sh
index c699ecb..4aeaa2a 100644
--- a/g.sh
+++ b/g.sh
@@ -65,7 +65,7 @@ save_shortcuts() {
# The main function for this script.
g() {
- version="0.3.1"
+ version="0.3.2"
cmd="$1"
gfile=$HOME/.gfile
declare -A gshortcuts
@@ -85,13 +85,15 @@ g() {
help
;;
add)
- path=`pwd`
- if [ "$#" != "2" ] && [ "$#" != "3" ]; then
- echo "usage: g add <name> [path]"
- return
- fi
- if [ "$#" == "3" ]; then
- path=$3
+ if [ "$#" == "2" ]; then
+ path=`pwd`
+ else
+ if [ "$#" == "3" ]; then
+ path=$3
+ else
+ echo "usage: g add <name> [path]"
+ return
+ fi
fi
get_shortcuts
gshortcuts[$2]=$path