aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-10 07:26:53 +0000
committerMike Frysinger <vapier@gentoo.org>2012-11-10 07:26:53 +0000
commite69cb1de54a33ae5f73ddc738f06d149347b071e (patch)
tree06546b3190d338e900c46f00765148bbd0a1e2be /lddtree.sh
parentlddtree: normalize linux osabi to sysv since they are compatible (with glibc)... (diff)
downloadpax-utils-e69cb1de54a33ae5f73ddc738f06d149347b071e.tar.gz
pax-utils-e69cb1de54a33ae5f73ddc738f06d149347b071e.tar.bz2
pax-utils-e69cb1de54a33ae5f73ddc738f06d149347b071e.zip
lddtree: add a -V (--version) flag
Diffstat (limited to 'lddtree.sh')
-rwxr-xr-xlddtree.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/lddtree.sh b/lddtree.sh
index 310e3da..495030d 100755
--- a/lddtree.sh
+++ b/lddtree.sh
@@ -2,7 +2,7 @@
# Copyright 2007-2012 Gentoo Foundation
# Copyright 2007-2012 Mike Frysinger <vapier@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.sh,v 1.14 2012/11/10 07:19:35 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.sh,v 1.15 2012/11/10 07:26:53 vapier Exp $
argv0=${0##*/}
@@ -19,12 +19,19 @@ usage() {
Options:
-a Show all duplicated dependencies
-x Run with debugging
- -h Show this help output
-R <root> Use this ROOT filesystem tree
+ -h Show this help output
+ -V Show version information
EOF
exit ${1:-0}
}
+version() {
+ local id='$Id: lddtree.sh,v 1.15 2012/11/10 07:26:53 vapier Exp $'
+ id=${id##*,v }
+ exec echo "lddtree-${id% * Exp*}"
+}
+
error() {
echo "${argv0}: $*" 1>&2
ret=1
@@ -172,11 +179,12 @@ if [[ $1 != "/../..source.lddtree" ]] ; then
SHOW_ALL=false
SET_X=false
-while getopts haxR: OPT ; do
+while getopts haxVR: OPT ; do
case ${OPT} in
a) SHOW_ALL=true;;
x) SET_X=true;;
h) usage;;
+ V) version;;
R) ROOT="${OPTARG%/}/";;
?) usage 1;;
esac