Changed the -v option to -V and made the -v option print sbopkg's version.

Thanks to Chess for discussion and review.
This commit is contained in:
slakmagik 2010-05-18 21:02:56 +00:00
parent f2914a56b3
commit ac4a19752a
2 changed files with 11 additions and 3 deletions

View File

@ -15,5 +15,8 @@ enhancements:
Slackware 13.1. Slackware 13.1.
* Added a help item to the main menu of the dialog interface with pointers * Added a help item to the main menu of the dialog interface with pointers
to documentation and other resources. to documentation and other resources.
* Added an option to print the version of sbopkg. We try not to change the
meaning of flags but note that this does change what was the '-v' flag to
'-V' and now uses '-v' for its customary 'version' purpose.
+--------------------------+ +--------------------------+

View File

@ -4391,7 +4391,7 @@ else
fi fi
# This is the command line options and help. # This is the command line options and help.
while getopts ":b:cd:e:f:g:hi:klopqrRs:uv:" OPT; do while getopts ":b:cd:e:f:g:hi:klopqrRs:uV:v" OPT; do
case $OPT in case $OPT in
b ) # Build b ) # Build
BFLAG=1 BFLAG=1
@ -4459,7 +4459,11 @@ while getopts ":b:cd:e:f:g:hi:klopqrRs:uv:" OPT; do
UPDATE=1 UPDATE=1
unset DIAG unset DIAG
;; ;;
v ) # Set repository v ) # print version
echo $SBOVER
exit
;;
V ) # Set repository
VERSION=1 VERSION=1
CUSTOMVER="$OPTARG" CUSTOMVER="$OPTARG"
;; ;;
@ -4489,7 +4493,8 @@ Options are:
-s package(s) Specific search by specific package and, if found, -s package(s) Specific search by specific package and, if found,
display package information. display package information.
-u Check for an update to sbopkg. -u Check for an update to sbopkg.
-v repo/branch Set the repository/branch (e.g. "-v SBo/13.0"). -v Print sbopkg's version on stdout.
-V repo/branch Set the repository/branch (e.g. "-v SBo/13.0").
If the repository name is not specified, sbopkg will first If the repository name is not specified, sbopkg will first
try with the default one. If no match is found, sbopkg will try with the default one. If no match is found, sbopkg will
look for the first matching branch of any repository. look for the first matching branch of any repository.