pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_leaves - Actually show usage() instead of...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8c6123e17828
branches:  trunk
changeset: 542567:8c6123e17828
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Wed May 21 15:24:40 2008 +0000

description:
- Actually show usage() instead of entering an infinite loop.
- improve usage
- bump version to 1.1

diffstat:

 pkgtools/pkg_leaves/Makefile         |   4 ++--
 pkgtools/pkg_leaves/files/pkg_leaves |  16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 0925269fa8ae -r 8c6123e17828 pkgtools/pkg_leaves/Makefile
--- a/pkgtools/pkg_leaves/Makefile      Wed May 21 15:23:19 2008 +0000
+++ b/pkgtools/pkg_leaves/Makefile      Wed May 21 15:24:40 2008 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.1.1.1 2008/05/15 17:44:42 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2008/05/21 15:24:40 tnn Exp $
 
-DISTNAME=      pkg_leaves-1.0
+DISTNAME=      pkg_leaves-1.1
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 0925269fa8ae -r 8c6123e17828 pkgtools/pkg_leaves/files/pkg_leaves
--- a/pkgtools/pkg_leaves/files/pkg_leaves      Wed May 21 15:23:19 2008 +0000
+++ b/pkgtools/pkg_leaves/files/pkg_leaves      Wed May 21 15:24:40 2008 +0000
@@ -32,10 +32,15 @@
 
 usage()
 {
-       echo "$0 [-a] [-K pkg_dbdir]"
-       echo "Print all automatically installed leaf packages."
-       echo "If -a is specified, print all leaf packages."
-       exit 1
+cat << EOF
+usage: $(basename "$0") [-a] [-K pkg_dbdir]
+       Prints all automatically installed leaf packages.
+
+  -a            Print all leaf packages, including manually installed ones.
+  -K <dir>      Specify alternate package database (default: ${PKG_DBDIR})
+
+EOF
+exit 1
 }
 
 while [ $# -gt 0 ] ; do
@@ -49,6 +54,9 @@
                shift
                shift
                ;;
+       *)
+               usage
+               ;;
        esac
 done
 



Home | Main Index | Thread Index | Old Index