File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2121 <PropertyGroup >
2222 <VersionPrefix Condition =" '$(VersionPrefix)' == ''" >2.0.0</VersionPrefix >
2323 <FileVersion >$(VersionPrefix).$(BuildNumber)</FileVersion >
24+ <InformationalVersion Condition =" '$(VersionSuffix)' != ''" >$(FileVersion)-$(VersionSuffix)</InformationalVersion >
2425 <Product >1C (BSL) language runtime</Product >
2526 <Copyright >Copyright (c) 2021 EvilBeaver</Copyright >
2627 </PropertyGroup >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ This Source Code Form is subject to the terms of the
66----------------------------------------------------------*/
77
88using System ;
9+ using System . Reflection ;
910using System . Text ;
1011
1112namespace oscript
@@ -41,5 +42,14 @@ public static int Main(string[] args)
4142
4243 return returnCode ;
4344 }
45+
46+ public static string GetVersion ( )
47+ {
48+ var assembly = Assembly . GetExecutingAssembly ( ) ;
49+ var informationVersion = assembly . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( ) ?
50+ . InformationalVersion ?? assembly . GetName ( ) . Version ? . ToString ( ) ?? "<unset>" ;
51+
52+ return informationVersion ;
53+ }
4454 }
4555}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ internal class ShowUsageBehavior : AppBehavior
1313 {
1414 public override int Execute ( )
1515 {
16- Output . WriteLine ( $ "1Script Execution Engine. Version { Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version } ") ;
16+ Output . WriteLine ( $ "1Script Execution Engine. Version { Program . GetVersion ( ) } ") ;
1717 Output . WriteLine ( ) ;
1818 Output . WriteLine ( "Usage:" ) ;
1919 Output . WriteLine ( ) ;
@@ -30,10 +30,8 @@ public override int Execute()
3030 Output . WriteLine ( " -encoding=<encoding-name> set output encoding" ) ;
3131 Output . WriteLine ( " -codestat=<filename> write code statistics" ) ;
3232 Output . WriteLine ( ) ;
33- Output . WriteLine ( "III. Build standalone executable: oscript.exe -make <script_path> <output_exe>" ) ;
34- Output . WriteLine ( " Builds a standalone executable module based on script specified" ) ;
3533 Output . WriteLine ( ) ;
36- Output . WriteLine ( "IV . Run as CGI application: oscript.exe -cgi <script_path> [script arguments..]" ) ;
34+ Output . WriteLine ( "III . Run as CGI application: oscript.exe -cgi <script_path> [script arguments..]" ) ;
3735 Output . WriteLine ( " Runs as CGI application under HTTP-server (Apache/Nginx/IIS/etc...)" ) ;
3836
3937 return 0 ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ internal class ShowVersionBehavior : AppBehavior
1313 {
1414 public override int Execute ( )
1515 {
16- Output . WriteLine ( $ " { Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version } " ) ;
16+ Output . WriteLine ( Program . GetVersion ( ) ) ;
1717 return 0 ;
1818 }
1919 }
You can’t perform that action at this time.
0 commit comments