Prevent bad input for stocks

It requires an argument
This commit is contained in:
Alex Epstein 2017-06-28 00:34:17 -04:00
parent 7ef1637098
commit 86164aff20
1 changed files with 3 additions and 0 deletions

View File

@ -136,8 +136,11 @@ while getopts "uv" opt; do
esac
done
if [[ $1 == "update" ]];then
update
elif [[ $# == "0" ]];then
echo "Error: requires an argument either stocks [company] or stocks [stock symbol]"
else
getTicker $1 $2 $3 $4 $5 $6 $7 $8 $9 # the company name might have spaces so passing in all args allows for this
getStockInformation $symbol # based on the stock symbol exrapolated by the getTicker function get information on the stock