xbps-src: add -h flag to show usage.

--HG--
extra : convert_revision : 51fbff55d296a3f818e736835a10763aff278f2d
This commit is contained in:
Juan RP 2010-04-27 14:23:53 +02:00
parent b59a6e55ff
commit 9ddcd8fe72
1 changed files with 7 additions and 6 deletions

View File

@ -38,7 +38,7 @@ trap "echo && exit 1" INT QUIT
usage()
{
cat << _EOF
$progname: [-C] [-c <config_file>] [-m <masterdir>] [-p <pkgdir>] <target>
$progname: [-Ch] [-c <config_file>] [-m <masterdir>] [-p <pkgdir>] <target>
Targets:
build Build a package (fetch + extract + configure + build).
@ -67,13 +67,13 @@ Options:
-C Do not remove build directory after successful installation.
-c Path to global configuration file:
if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used.
-h Usage output.
-m Master directory, overwritting the value set in the configuration
file at @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf.
-p Package directory, overwritting default path at
<XBPS_MASTERDIR>/pkg-binpkgs.
_EOF
exit 1
}
basename_cwd()
@ -135,10 +135,11 @@ check_config_vars()
#
# main()
#
while getopts "Cc:m:p:" opt; do
while getopts "Cc:hm:p:" opt; do
case $opt in
C) export dontrm_builddir=yes;;
c) config_file_specified=yes; XBPS_CONFIG_FILE="$OPTARG";;
h) usage && exit 0;;
m)
_MASTERDIR="$OPTARG"
if [ ! -d ${_MASTERDIR} ]; then
@ -157,12 +158,12 @@ while getopts "Cc:m:p:" opt; do
done
shift $(($OPTIND - 1))
[ $# -eq 0 -o $# -gt 2 ] && usage
[ $# -eq 0 -o $# -gt 2 ] && usage && exit 1
target="$1"
if [ -z "$target" ]; then
echo "=> ERROR: missing target."
usage
usage && exit 1
fi
#
@ -312,7 +313,7 @@ unstow)
;;
*)
echo "=> ERROR: invalid target: $target."
usage
usage && exit 1
esac
# Agur