diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-11-10 07:26:53 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-11-10 07:26:53 +0000 |
commit | e69cb1de54a33ae5f73ddc738f06d149347b071e (patch) | |
tree | 06546b3190d338e900c46f00765148bbd0a1e2be /lddtree.sh | |
parent | lddtree: normalize linux osabi to sysv since they are compatible (with glibc)... (diff) | |
download | pax-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-x | lddtree.sh | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 |