[arch-projects] [mkinitcpio][PATCH 2/2] lsinitcpio: Add -V/--version option to display version
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> --- lsinitcpio | 14 ++++++++++++-- 1 file 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) -- 1.8.0
participants (1)
-
Eric Bélanger