diff options
| author | Miquel Sabaté <msabate@suse.com> | 2015-07-28 09:43:54 +0200 |
|---|---|---|
| committer | Miquel Sabaté <msabate@suse.com> | 2015-07-28 09:43:54 +0200 |
| commit | 8606da8b5112897f8abddd5bfafd3a8939795621 (patch) | |
| tree | bd1f2b82fc803b8e9bcf7bd367a33aa205ec58ee /g.sh | |
| parent | 3b18f5039369f2bea673b0bcf1c6dcbb459f248f (diff) | |
| download | g-8606da8b5112897f8abddd5bfafd3a8939795621.tar.gz g-8606da8b5112897f8abddd5bfafd3a8939795621.zip | |
Use a proper if-else branch...
Diffstat (limited to 'g.sh')
| -rw-r--r-- | g.sh | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |
