[Gambas-user] gbs script version

Brian G brian at westwoodsvcs.com
Tue Feb 16 21:56:47 CET 2021


Follows is an example of what a script may look like 

#!/usr/bin/env -S gbs3 -c 
Export 
Fast Unsafe 

#ProjectOptions title="westwood.testlib1",type=Program,version="1.0.5" 
#ProjectOptions vendor=westwood 

include "TestScripterInclude" ,"TestScripterBadMain" 
#include "TestScripterLoop","TestScripterInclude" 



public sDog as string = "Bark Bark" 
private sCat as string = "Meow Meow" 

public struct MyDog 
cat as string 
puppy as integer 
end struct 

use "gb.eval.highlight" ,"westwood.testmakecomp:" 

class testlibclass 
Fast Unsafe 

export 

Public Struct frog 
croak as string 
hop as integer 
end struct 

public a as string 
Public b as string 
end class 

public sub main() 

dim a as new testlibclass 
dim ca as new test2 
dim b as new MyDog 

b.cat = "This stuff" 

a.a = "this" 
Print "Output ***********************************" 
print a.a;;b.cat 
Print "Total=";ca.GetTotal() 

end 

public sub foxtrot() 
print "FoxTrot to tango" 
end 


Thank You 
Brian G 


From: "Brian" <brian at westwoodsvcs.com> 
To: "Gambas mailing list" <user at lists.gambas-basic.org> 
Sent: Tuesday, February 16, 2021 12:01:18 PM 
Subject: Re: [Gambas-user] gbs script version 



I had the same issue some time ago 


-- 
Thanks 
Brian 
Tuesday, 16 February 2021, 00:00PM -08:00 from Brian G [ mailto:brian at westwoodsvcs.com | brian at westwoodsvcs.com ] : 






I have added a preprocess to set the version number 


-- 
Thanks 
Brian 
Tuesday, 16 February 2021, 10:19AM -08:00 from Bruce Steers [ mailto:bsteers4 at gmail.com | bsteers4 at gmail.com ] : 


BQ_BEGIN



On Tue, 16 Feb 2021 at 17:52, Benoît Minisini < [ mailto:g4mba5 at gmail.com | g4mba5 at gmail.com ] > wrote: 

BQ_BEGIN
Le 16/02/2021 à 18:40, Bruce Steers a écrit : 
> 
> 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. 
> 
> 
> I can think of other reasons overriding gb.args version for DIY could be 
> useful.. 
> 
> Eg. 
> *If Args.Has("V", "version" , "Display version and state") Then* 
> * Print Application.Version & Iif($bAppIsBetaStage, " (Beta)", " (Stable)") 
> * 
> *Endif* 
> 
> Other things i thought were if Application.Version was read/write that 
> would fix the gbs versioning as could be set at script start 
> Wishing well 
> BruceS 
> 

To be logical, you should check the override of "-h" too. Someone may 
want to display its own help instead of the default one. 




yes i did consider that , I was not sure if you would accept the modification but if you think it's okay i have re-submitted with both help and version override. 

Thank you 
BruceS 

----[ [ http://gambaswiki.org/wiki/doc/netiquette | http://gambaswiki.org/wiki/doc/netiquette ] ]---- 


BQ_END


BQ_END


----[ http://gambaswiki.org/wiki/doc/netiquette ]---- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210216/1a059b9b/attachment-0001.htm>


More information about the User mailing list