From 35c0df4330d4623e2c403bd7acade2013b0a7f3f Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Date: Sun, 16 Feb 2014 17:34:43 +0100 Subject: The third argument for the add command is now optional. The current working directory will be used if the third argument was not given. --- g.sh | 10 +++++++--- 1 file 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 " + path=`pwd` + if [ "$#" != "2" ] && [ "$#" != "3" ]; then + echo "usage: g add [path]" return fi + if [ "$#" == "3" ]; then + path=$3 + fi get_shortcuts - gshortcuts[$2]=$3 + gshortcuts[$2]=$path save_shortcuts ;; rm) -- cgit v1.2.3