[23079] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r22742 - trunk/debathena/scripts

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Fri Feb 8 10:45:11 2008

Date: Fri, 8 Feb 2008 10:44:59 -0500 (EST)
From: ghudson@MIT.EDU
Message-Id: <200802081544.KAA12743@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: ghudson
Date: 2008-02-08 10:44:58 -0500 (Fri, 08 Feb 2008)
New Revision: 22742

Modified:
   trunk/debathena/scripts/dasource
Log:
* debathena/scripts/dasource: Fix the handling of invalid options.


Modified: trunk/debathena/scripts/dasource
===================================================================
--- trunk/debathena/scripts/dasource	2008-02-08 05:32:32 UTC (rev 22741)
+++ trunk/debathena/scripts/dasource	2008-02-08 15:44:58 UTC (rev 22742)
@@ -15,6 +15,15 @@
 
 set -e
 
+die() {
+  echo "$@" >&2
+  exit 1
+}
+
+usage() {
+  die "dasource [-r repos] [packagename ...]"
+}
+
 : ${DEBATHENA_APT=/mit/debathena/apt}
 basedir=$(dirname "$0")
 pkgfile=$basedir/packages
@@ -26,17 +35,11 @@
     type="$OPTARG"
     ;;
   \?)
-    echo "$usage"
-    exit 1
+    usage
     ;;
   esac
 done
 
-die() {
-  echo "$@" >&2
-  exit 1
-}
-
 do_package() {
   pkgname=$1
   pkgpath=$2


home help back first fref pref prev next nref lref last post