Commit cb5626c5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: get package names from stdin if it is pipe

parent a377766a
......@@ -292,18 +292,30 @@ check_option()
return 0
}
for opt in "$@" ; do
check_command $opt && continue
check_option $opt && continue
check_filenames()
{
local opt="$1"
if [ -f "$opt" ] && echo $opt | grep -q "\." ; then
pkg_files="$pkg_files $opt"
else
pkg_names="$pkg_names $opt"
fi
quoted_args="$quoted_args \"$opt\""
}
for opt in "$@" ; do
check_command $opt && continue
check_option $opt && continue
check_filenames $opt
done
# if input is not console, get pkg from it too
if ! tty -s ; then
for opt in $(cat) ; do
check_filenames $opt
done
fi
pkg_files=$(strip_spaces "$pkg_files")
pkg_names=$(strip_spaces "$pkg_names")
......
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