aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-apt-config
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2010-01-25 15:50:18 +0100
committerLoïc Minier <lool@dooz.org>2010-01-25 15:50:18 +0100
commit9880e5ad0e0ab83060825843c29a969ae82dfe69 (patch)
treea808c5985b6ba5718bdcd4ebf880afb5dc34af7d /pbuilder-apt-config
parentcf0359b77b03f2b51b18dccdda5a71984e16ba19 (diff)
downloadpbuilder-9880e5ad0e0ab83060825843c29a969ae82dfe69.tar
pbuilder-9880e5ad0e0ab83060825843c29a969ae82dfe69.tar.gz
Add --help and rework usage()
Diffstat (limited to 'pbuilder-apt-config')
-rwxr-xr-xpbuilder-apt-config43
1 files changed, 27 insertions, 16 deletions
diff --git a/pbuilder-apt-config b/pbuilder-apt-config
index 56ea807..4fc0f7f 100755
--- a/pbuilder-apt-config
+++ b/pbuilder-apt-config
@@ -14,8 +14,14 @@ log() {
}
usage() {
- log "$self [--with-sources=[yes|no|disabled]] [--arch=<arch>] [--components=<comp1>,<comp2>] [--mirror=<mirror>] [--suite=<suite>] [--pockets=<pocket1>,<pocket2>]" >&2
- log "$self [--with-sources=[yes|no|disabled]] [--arch=<arch>] [--components=<comp1>,<comp2>] [--profile=<profile>]" >&2
+ log "$self [<options>] [--mirror=<mirror>] [--suite=<suite>] [--pockets=<pocket1>,<pocket2>] <action>"
+ log "$self [--profile=<profile>] <action>"
+ log " where <action> is one of apt-sources, debootstrap-mirror, or debootstrap-suite"
+ log
+ log "Common options:"
+ log " --with-sources, --with-sources=[yes|no|disabled]"
+ log " --arch=<arch>"
+ log " --components=<comp1>,<comp2>"
}
die() {
@@ -99,7 +105,7 @@ output_sources() {
esac
}
-getopt_output="`getopt -o "" -l with-sources::,arch:,components:,mirror:,suite:,pockets:,profile: -n "$self" -s sh -- "$@"`"
+getopt_output="`getopt -o "" -l help,with-sources::,arch:,components:,mirror:,suite:,pockets:,profile: -n "$self" -s sh -- "$@"`"
eval set -- "$getopt_output"
@@ -114,6 +120,10 @@ profile=""
while :; do
case "$1" in
+ --help)
+ usage
+ exit 0
+ ;;
--with-sources)
case "$2" in
"")
@@ -174,19 +184,6 @@ while :; do
esac
done
-case $# in
- 0)
- command="sources"
- ;;
- 1)
- command="$1"
- ;;
- 2)
- usage
- exit 1
- ;;
-esac
-
if [ -z "$suite" ] && [ -z "$profile" ]; then
die "Please pass --suite or --profile"
fi
@@ -294,3 +291,17 @@ if [ -n "$suite" ]; then
exit 0
fi
+command="$1"
+case $1 in
+ apt-sources)
+ ;;
+ debootstrap-mirror)
+ ;;
+ debootstrap-suite)
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
+