@@ -21,11 +21,11 @@ internal class Options
2121
2222 [ Option ( 'i' , "ip" , Required = false ,
2323 HelpText = "IP to send to" ) ]
24- public string IP { get ; set ; }
24+ public string ? IP { get ; set ; }
2525
2626 [ Option ( 'l' , "url" , Required = false ,
2727 HelpText = "URL to send to" ) ]
28- public string Url { get ; set ; }
28+ public string ? Url { get ; set ; }
2929
3030 [ Option ( 'p' , "port" , Required = false ,
3131 HelpText = "the Port to send to" ) ]
@@ -60,7 +60,7 @@ public static int Main(string[] args)
6060
6161 logConfig . WriteTo . ColoredConsole ( ) ;
6262
63- if ( options . Url . Length > 0 )
63+ if ( options . Url ? . Length > 0 )
6464 {
6565 if ( options . UDP )
6666 {
@@ -71,10 +71,9 @@ public static int Main(string[] args)
7171 logConfig . WriteTo . TCPSink ( options . Url , options . Port , null , null , new LogstashJsonFormatter ( ) ) ;
7272 }
7373 }
74- else if ( options . IP . Length > 0 )
74+ else if ( options . IP ? . Length > 0 )
7575 {
76- IPAddress ipAddress ;
77- if ( ! IPAddress . TryParse ( options . IP , out ipAddress ) )
76+ if ( ! IPAddress . TryParse ( options . IP , out var ipAddress ) )
7877 {
7978 Console . WriteLine ( "Could not parse " + options . IP + " as an IP address" ) ;
8079 return 1 ;
0 commit comments