summaryrefslogtreecommitdiffstats
path: root/lsinitcpio
diff options
context:
space:
mode:
Diffstat (limited to 'lsinitcpio')
-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)