Exit 0 when showing help, and support -h.

This commit is contained in:
Stefano Rivera 2011-04-24 16:01:42 +02:00
parent dfc7a2ce26
commit ebe04d88b0
3 changed files with 8 additions and 5 deletions

1
debian/changelog vendored
View File

@ -3,6 +3,7 @@ ubuntu-dev-tools (0.123) UNRELEASED; urgency=low
* mk-sbuild:
- Disable daemons with a policy-rc.d script (like pbuilder does)
- Move package installation after option parsing.
- Exit 0 when showing help, and support -h.
-- Stefano Rivera <stefanor@debian.org> Sun, 24 Apr 2011 12:45:31 +0200

View File

@ -70,14 +70,17 @@ function usage()
echo " DEBOOTSTRAP_EXCLUDE Excluded packages (same as --debootstrap-exclude)"
echo " TEMPLATE_SOURCES A template for sources.list"
echo " TEMPLATE_SCHROOTCONF A template for schroot.conf stanza"
exit 1
if [ -z "$1" ]; then
exit 1
fi
exit $1
}
if [ -z "$1" ]; then
usage
fi
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,debootstrap-include:,debootstrap-exclude:,personality:,distro:,vg:,type:" -- "$@"`
OPTS=`getopt -o 'h' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,debootstrap-include:,debootstrap-exclude:,personality:,distro:,vg:,type:" -- "$@"`
eval set -- "$OPTS"
VG=""
@ -145,8 +148,8 @@ while :; do
shift
break
;;
--help|*)
usage
-h|--help|*)
usage 0
;;
esac
done

View File

@ -32,7 +32,6 @@ BLACKLIST = {
'grep-merges': 'No Help',
'lp-project-upload': 'Returns non-zero after help. '
'Leaving u-d-t in LP: #524680',
'mk-sbuild': 'Fires up apt-get before showing help',
'pbuilder-dist-simple': 'No Help',
'setup-packaging-environment': 'Throws Error',
'submittodebian': 'No Help',