diff options
| author | Miquel Sabaté <mikisabate@gmail.com> | 2014-02-16 17:34:43 +0100 |
|---|---|---|
| committer | Miquel Sabaté <mikisabate@gmail.com> | 2014-02-16 17:34:43 +0100 |
| commit | 35c0df4330d4623e2c403bd7acade2013b0a7f3f (patch) | |
| tree | da25b6964ec49396f6b549e2a4d9d5dbe7554b6a /g.sh | |
| parent | 41fa909309f7b02848823605f79378a74f0d343e (diff) | |
| download | g-35c0df4330d4623e2c403bd7acade2013b0a7f3f.tar.gz g-35c0df4330d4623e2c403bd7acade2013b0a7f3f.zip | |
The third argument for the add command is now optional.
The current working directory will be used if the third argument was not given.
Diffstat (limited to 'g.sh')
| -rw-r--r-- | g.sh | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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) |
