[Gambas-user] gbs script version

Bruce Steers bsteers4 at gmail.com
Tue Feb 16 17:22:01 CET 2021


On Tue, 16 Feb 2021 at 15:14, Benoît Minisini <g4mba5 at gmail.com> wrote:

> Le 16/02/2021 à 15:41, Bruce Steers a écrit :
> >
> > So i just used gb.args in a gbs script and gb.args auto uses the -V flag
> > to display version.
> >
> > But i cannot see how to set version using a script file?
> > all i get is 0.0.0
> >
> > Is it possible?
> > Thank you
> > BruceS
> >
>
> Apparently no.
>

Thanks Ben

In the script file i can manually check Args.Has("V","version","Display
Version") and that works.
The downside is that if i manually try to check -V it does override the
function but duplicates the help info.

$ ./SetVers2.gbs -h
SetVers2 <dir> <pattern> <version> <files...>

Options:
 -d --directory <dir>               Path to the project
 -p --pattern <pattern>          search pattern
 -v --version-num <version>  Set version number
 *-V --version                          Display version info  *(this was
the one i manually entered)

* -V --version                          Display version *-h --help
                      Display this help

$ ./SetVers2.gbs -V
1.0.0

I've submitted a merge request for a simple change to gb.args to fix this
if it's okay with you.
It sets  $bVersionChecked to true if user has used Args.Has() to check -V
and stops --help printing built in version message if so.

Much respect
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210216/ed458e6a/attachment.htm>


More information about the User mailing list