From 284d48138bbea258aae96438747e89e23a1ece85 Mon Sep 17 00:00:00 2001 From: Josh Ashton Date: Tue, 13 Jun 2023 22:00:08 -0600 Subject: [PATCH] minor bug fix to ensure improper usage message is displayed --- lookup | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lookup b/lookup index 8693c90..8b1df95 100755 --- a/lookup +++ b/lookup @@ -1,16 +1,6 @@ #!/bin/zsh - -# Catch any invalid input. -if [[ $# -eq 0 || $# -gt 2 ]]; then - echo "Improper usage: lookup [command] [search term]" - echo "Available commands:" - echo " user [user]" - echo " eg. lookup user quaxlyqueen" - echo " repo [user] [repo]" - echo " eg. lookup repo quaxlyqueen/dnd" - # Display help. -elif [[ $1 == "-h" || $1 == "--help" ]]; then +if [[ $1 == "-h" || $1 == "--help" ]]; then echo "Available commands:" echo " user [user]" echo " eg. lookup user quaxlyqueen" @@ -28,4 +18,14 @@ elif [[ $1 == "repo" ]]; then # TODO need to implement. firefox https://github.com/$2 + +# Catch any invalid input. +else + echo "Improper usage: lookup [command] [search term]" + echo "Available commands:" + echo " user [user]" + echo " eg. lookup user quaxlyqueen" + echo " repo [user] [repo]" + echo " eg. lookup repo quaxlyqueen/dnd" + fi