Commit dfb9b480 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: add echocmd (special for command print out) and use it in the empty arg error message

parent 58d42515
...@@ -551,12 +551,12 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names") ...@@ -551,12 +551,12 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
# Just printout help if run without args # Just printout help if run without args
if [ -z "$epm_cmd" ] ; then if [ -z "$epm_cmd" ] ; then
print_version print_version >&2
echo echo >&2
fatstr="Unknown command in $* arg(s)" fatstr="Unrecognized command in '$*' arg(s)"
[ -n "$*" ] || fatstr="That program needs be running with some command" [ -n "$*" ] || fatstr="That program needs be running with some command"
echo "Run $ $PROGNAME --help to get help." >&2 echo "Run $(echocmd "$PROGNAME --help") to get help." >&2
echo "Run $ epm print info to get some system and distro info." >&2 echo "Run $(echocmd "epm print info") to get some system and distro info." >&2
fatal "$fatstr." fatal "$fatstr."
fi fi
......
...@@ -129,6 +129,16 @@ showcmd() ...@@ -129,6 +129,16 @@ showcmd()
fi >&2 fi >&2
} }
# Print command
echocmd()
{
set_boldcolor $GREEN
local PROMTSIG="\$"
is_root && PROMTSIG="#"
echo -n "$PROMTSIG $*"
restore_color
}
# Print command line and run command line # Print command line and run command line
docmd() docmd()
{ {
......
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