aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--g.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/g.sh b/g.sh
index 37d8dbe..5e2fe51 100644
--- a/g.sh
+++ b/g.sh
@@ -82,12 +82,16 @@ g() {
help
;;
add)
- if [ "$#" != "3" ]; then
- echo "usage: g add <name> <path>"
+ path=`pwd`
+ if [ "$#" != "2" ] && [ "$#" != "3" ]; then
+ echo "usage: g add <name> [path]"
return
fi
+ if [ "$#" == "3" ]; then
+ path=$3
+ fi
get_shortcuts
- gshortcuts[$2]=$3
+ gshortcuts[$2]=$path
save_shortcuts
;;
rm)