diff options
-rwxr-xr-x | lsinitcpio | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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) |