mirror of
https://github.com/shvedes/photoshop-linux.git
synced 2025-09-09 12:45:06 +00:00
⚒ getopts: check only getopts options
This commit is contained in:
parent
f9b50f3a1b
commit
9217d9aea9
22
install.sh
22
install.sh
@ -463,13 +463,19 @@ main() {
|
|||||||
echo -e "$SUCCES Photoshop is successfully installed."
|
echo -e "$SUCCES Photoshop is successfully installed."
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ -n $1 && $1 != -* ]]; then
|
||||||
get_help
|
echo "Invalid input: options must start with '-'"
|
||||||
exit 0
|
get_help
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "a:i:h" flag; do
|
if [ -z "$1" ]; then
|
||||||
case $flag in
|
get_help
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while getopts "a:i:h" opt; do
|
||||||
|
case "$opt" in
|
||||||
a)
|
a)
|
||||||
LOCAL_ARCHIVE="$OPTARG"
|
LOCAL_ARCHIVE="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@ -479,7 +485,11 @@ while getopts "a:i:h" flag; do
|
|||||||
i)
|
i)
|
||||||
INSTALL_PATH="$OPTARG"
|
INSTALL_PATH="$OPTARG"
|
||||||
;;
|
;;
|
||||||
\?)
|
:)
|
||||||
|
echo "Option -${OPTARG} requires an argument"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
?)
|
||||||
echo "Invalid option: -$OPTARG Use -h for help."
|
echo "Invalid option: -$OPTARG Use -h for help."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user