Commit 35735b2b authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: fill epm_cmd only one time

parent 0bb0dc3b
...@@ -84,26 +84,12 @@ case $progname in ...@@ -84,26 +84,12 @@ case $progname in
;; ;;
esac esac
for opt in "$@" ; do check_command()
case $opt in {
-h|--help|help) # HELPOPT: this help # do not override command
phelp; exit 0 [ -z "$epm_cmd" ] || return
;;
-v|--version) # HELPOPT: print version case $1 in
print_version; exit 0
;;
--verbose) # HELPOPT: verbose mode
verbose=1
;;
--skip-installed) # HELPOPT: skip already install during install
skip_installed=1
;;
--quiet) # HELPOPT: quiet mode (do not print commands before exec)
quiet=1
;;
--auto) # HELPOPT: non interactive mode
non_interactive=1
;;
-i|install|add) # HELPCMD: install package(s) from remote repositories or from local file -i|install|add) # HELPCMD: install package(s) from remote repositories or from local file
epm_cmd=install epm_cmd=install
;; ;;
...@@ -150,6 +136,33 @@ for opt in "$@" ; do ...@@ -150,6 +136,33 @@ for opt in "$@" ; do
epm_cmd=simulate epm_cmd=simulate
;; ;;
*) *)
return 1
esac
return 0
}
for opt in "$@" ; do
check_command $opt && continue
case $opt in
-h|--help|help) # HELPOPT: this help
phelp; exit 0
;;
-v|--version) # HELPOPT: print version
print_version; exit 0
;;
--verbose) # HELPOPT: verbose mode
verbose=1
;;
--skip-installed) # HELPOPT: skip already install during install
skip_installed=1
;;
--quiet) # HELPOPT: quiet mode (do not print commands before exec)
quiet=1
;;
--auto) # HELPOPT: non interactive mode
non_interactive=1
;;
*)
if [ -f "$opt" ] ; then if [ -f "$opt" ] ; then
pkg_files="$pkg_files $opt" pkg_files="$pkg_files $opt"
else else
......
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