Commit 38c1ca7e authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: move check option to separate function

parent 00fcfd5b
...@@ -176,13 +176,14 @@ check_command() ...@@ -176,13 +176,14 @@ check_command()
;; ;;
*) *)
return 1 return 1
;;
esac esac
return 0 return 0
} }
for opt in "$@" ; do check_option()
check_command $opt && continue {
case $opt in case $1 in
-h|--help|help) # HELPOPT: this help -h|--help|help) # HELPOPT: this help
phelp phelp
exit 0 exit 0
...@@ -213,13 +214,21 @@ for opt in "$@" ; do ...@@ -213,13 +214,21 @@ for opt in "$@" ; do
non_interactive=1 non_interactive=1
;; ;;
*) *)
return 1
;;
esac
return 0
}
for opt in "$@" ; do
check_command $opt && continue
check_option $opt && continue
if [ -f "$opt" ] ; then if [ -f "$opt" ] ; then
pkg_files="$pkg_files $opt" pkg_files="$pkg_files $opt"
else else
pkg_names="$pkg_names $opt" pkg_names="$pkg_names $opt"
fi fi
;;
esac
done done
pkg_files=$(strip_spaces "$pkg_files") pkg_files=$(strip_spaces "$pkg_files")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment