Commit 7e526a27 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: move help to separate epm_<command>_help() function

parent 73057bf2
......@@ -293,6 +293,16 @@ esac
}
epm_mark_help()
{
echo "mark is the interface for marking packages"
get_help HELPCMD $SHAREDIR/epm-mark
cat <<EOF
Examples:
epm mark hold mc
epm manual mc
EOF
}
epm_mark()
{
......@@ -300,13 +310,7 @@ epm_mark()
[ -n "$CMD" ] && shift
case "$CMD" in
""|"-h"|"--help"|help) # HELPCMD: help
echo "mark is the interface for marking packages"
get_help HELPCMD $SHAREDIR/epm-mark
cat <<EOF
Examples:
epm mark hold mc
epm manual mc
EOF
epm_mark_help
;;
hold) # HELPCMD: mark the given package(s) as held back
epm_mark_hold "$@"
......
......@@ -215,7 +215,7 @@ __epm_play_list()
}
__epm_play_help()
epm_play_help()
{
cat <<EOF
Usage: epm play [options] [<app>]
......@@ -237,7 +237,7 @@ local psdir="$(realpath $CONFIGDIR/play.d)"
local prsdir="$(realpath $CONFIGDIR/prescription.d)"
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
__epm_play_help
epm_play_help
exit
fi
......
......@@ -256,6 +256,26 @@ construct_name()
echo "${name}${version}${pds}$arch.$pkgtype"
}
epm_print_help()
{
cat <<EOF
Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file
epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file
epm print version-release [from filename|for package] NN print only release-release of package name or package file
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for the package file
epm print srcname from filename NN print source name for the package file
epm print srcpkgname from [filename|package] NN print source package name for the binary package file
epm print specname from filename NN print spec filename for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print compare [package] version N1 N2 compare (package) versions and print -1, 0, 1
epm print constructname <name> <version> [arch] [ pkgtype] print distro dependend package filename from args name version arch pkgtype
EOF
}
epm_print()
{
local WHAT="$1"
......@@ -281,22 +301,7 @@ epm_print()
fatal "Use epm print help to get help."
;;
"-h"|"--help"|"help")
cat <<EOF
Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file
epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file
epm print version-release [from filename|for package] NN print only release-release of package name or package file
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for the package file
epm print srcname from filename NN print source name for the package file
epm print srcpkgname from [filename|package] NN print source package name for the binary package file
epm print specname from filename NN print spec filename for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print compare [package] version N1 N2 compare (package) versions and print -1, 0, 1
epm print constructname <name> <version> [arch] [ pkgtype] print distro dependend package filename from args name version arch pkgtype
EOF
epm_print_help
;;
"name")
[ -n "$1" ] || fatal "Arg is missed"
......
......@@ -19,20 +19,26 @@
load_helper epm-sh-altlinux
epm_repo()
epm_repo_help()
{
local CMD="$1"
[ -n "$CMD" ] && shift
case $CMD in
"-h"|"--help"|help) # HELPCMD: help
get_help HELPCMD $SHAREDIR/epm-repo
cat <<EOF
get_help HELPCMD $SHAREDIR/epm-repo
cat <<EOF
Examples:
epm repo set p9
epm repo add autoimports
epm repo list
epm repo change yandex
EOF
}
epm_repo()
{
local CMD="$1"
[ -n "$CMD" ] && shift
case $CMD in
"-h"|"--help"|help) # HELPCMD: help
epm_repo_help
;;
""|list) # HELPCMD: list packages
load_helper epm-repolist
......
......@@ -17,7 +17,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
epm_tool_help()
{
echo "Tools embedded in epm:"
get_help HELPCMD $SHAREDIR/epm-tool
cat <<EOF
Examples:
epm tool eget -U http://ya.ru
epm tool estrlist union a b a c
EOF
}
epm_tool()
{
......@@ -29,14 +39,7 @@ epm_tool()
fatal "Use epm tool help to get help."
;;
"-h"|"--help"|"help")
echo "Tools embedded in epm:"
get_help HELPCMD $SHAREDIR/epm-tool
cat <<EOF
Examples:
epm tool eget -U http://ya.ru
epm tool estrlist union a b a c
EOF
epm_tool_help
;;
"eget") # HELPCMD: downloading tool (simular to wget or curl)
showcmd eget "$@"
......
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