@@ -16,24 +16,26 @@ You should have received a copy of the GNU General Public License
16
16
along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
*/
18
18
19
- using Microsoft . Extensions . CommandLineUtils ;
20
- using Microsoft . Extensions . DependencyInjection ;
21
- using Microsoft . Extensions . Hosting ;
22
19
using System ;
23
20
using System . IO ;
24
21
using System . Linq ;
25
22
using System . Reflection ;
23
+ using Microsoft . Extensions . CommandLineUtils ;
24
+ using Microsoft . Extensions . DependencyInjection ;
25
+ using Microsoft . Extensions . Hosting ;
26
+
27
+ [ assembly: CLSCompliant ( true ) ]
26
28
27
29
namespace UsbIpServer
28
30
{
29
31
static class Program
30
32
{
31
- static string Product { get => Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyProductAttribute > ( ) ! . Product ; }
32
- static string Copyright { get => Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyCopyrightAttribute > ( ) ! . Copyright ; }
33
+ static string Product => Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyProductAttribute > ( ) ! . Product ;
34
+ static string Copyright => Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyCopyrightAttribute > ( ) ! . Copyright ;
33
35
34
36
static void ShowCopyright ( )
35
37
{
36
- Console . WriteLine ( $@ "{ Product } { GitVersionInformation . FullSemVer }
38
+ Console . WriteLine ( $@ "{ Product } { GitVersionInformation . MajorMinorPatch }
37
39
{ Copyright }
38
40
39
41
This program is free software: you can redistribute it and/or modify
@@ -57,7 +59,7 @@ static int Main(string[] args)
57
59
{
58
60
Name = Path . ChangeExtension ( Path . GetFileName ( Assembly . GetExecutingAssembly ( ) . Location ) , "exe" ) ,
59
61
} ;
60
- app . VersionOption ( "-v|--version" , GitVersionInformation . FullSemVer , GitVersionInformation . InformationalVersion ) ;
62
+ app . VersionOption ( "-v|--version" , GitVersionInformation . MajorMinorPatch , GitVersionInformation . InformationalVersion ) ;
61
63
62
64
void DefaultCmdLine ( CommandLineApplication cmd )
63
65
{
@@ -69,10 +71,12 @@ void DefaultCmdLine(CommandLineApplication cmd)
69
71
70
72
DefaultCmdLine ( app ) ;
71
73
app . OptionHelp . ShowInHelpText = true ;
72
- app . Command ( "license" , ( cmd ) => {
74
+ app . Command ( "license" , ( cmd ) =>
75
+ {
73
76
cmd . Description = "Display license information" ;
74
77
DefaultCmdLine ( cmd ) ;
75
- cmd . OnExecute ( ( ) => {
78
+ cmd . OnExecute ( ( ) =>
79
+ {
76
80
ShowCopyright ( ) ;
77
81
return 0 ;
78
82
} ) ;
@@ -91,14 +95,16 @@ void DefaultCmdLine(CommandLineApplication cmd)
91
95
cmd . Option ( "-b|--busid=<busid>" , "Unbind VBoxUsb.sys from device on <busid>" , CommandOptionType . SingleValue ) ;
92
96
} ) ;
93
97
#endif
94
- app . Command ( "server" , ( cmd ) => {
98
+ app . Command ( "server" , ( cmd ) =>
99
+ {
95
100
cmd . Description = "Run the server stand-alone on the console" ;
96
101
DefaultCmdLine ( cmd ) ;
97
102
cmd . Argument ( "key=value" , ".NET configuration override" , true ) ;
98
103
cmd . OnExecute ( ( ) => ExecuteServer ( cmd . Arguments . Single ( ) . Values . ToArray ( ) ) ) ;
99
104
} ) ;
100
105
101
- app . OnExecute ( ( ) => {
106
+ app . OnExecute ( ( ) =>
107
+ {
102
108
app . ShowRootCommandFullNameAndVersion ( ) ;
103
109
app . ShowHint ( ) ;
104
110
return 0 ;
0 commit comments