summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bélanger <snowmaniscool@gmail.com>2012-10-24 22:00:05 +0200
committerDave Reisner <dreisner@archlinux.org>2012-10-25 02:49:15 +0200
commit616ce3f20a1f17ffb0ae5824ad1e44dc88c3da07 (patch)
treef5a88ec267c81a3ce05532fb22447811e519bb81
parent0cdd65ec02af63c91873dd068f9ca2d6f8959ca3 (diff)
downloadmkinitcpio-616ce3f20a1f17ffb0ae5824ad1e44dc88c3da07.tar.gz
mkinitcpio-616ce3f20a1f17ffb0ae5824ad1e44dc88c3da07.tar.xz
lsinitcpio: Add -V/--version option to display version
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
-rwxr-xr-xlsinitcpio14
1 files changed, 12 insertions, 2 deletions
diff --git a/lsinitcpio b/lsinitcpio
index f94dd8c..1b4416d 100755
--- a/lsinitcpio
+++ b/lsinitcpio
@@ -23,11 +23,18 @@ usage: ${0##*/} [action] [options] <initramfs>
Options:
-h, --help display this help
-n, --nocolor disable colorized output
+ -V, --version display version information
-v, --verbose more verbose output
USAGE
}
+version() {
+ cat<<EOF
+lsinitcpio %VERSION%
+EOF
+}
+
decomp() {
${_compress:-cat} ${_compress:+-cd} "$@"
}
@@ -164,8 +171,8 @@ analyze_image() {
fi
}
-_opt_short='achlnvx'
-_opt_long=('analyze' 'help' 'list' 'nocolor' 'showconfig' 'verbose' 'extract')
+_opt_short='achlnVvx'
+_opt_long=('analyze' 'help' 'list' 'nocolor' 'showconfig' 'version' 'verbose' 'extract')
if ! parseopts "$_opt_short" "${_opt_long[@]}" -- "$@"; then
exit 1
@@ -186,6 +193,9 @@ while :; do
_optlistcontents=1 ;;
-n|--nocolor)
_optcolor=0 ;;
+ -V|--version)
+ version
+ exit 0 ;;
-v|--verbose)
_optverbose='--verbose' ;;
-x|--extract)