@@ -21,11 +21,12 @@ public partial class MainService
2121 {
2222 public int OnStartWithCommandLine ( string [ ] args )
2323 {
24- RootCommand rootCommand = new ( Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyTitleAttribute > ( ) ! . Title )
24+ var rootCommand = new RootCommand ( Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyTitleAttribute > ( ) ! . Title )
2525 {
2626 new Option < string > ( [ "-c" , "--config" , "/config" ] , "Specifies the config file." ) ,
2727 new Option < string > ( [ "-w" , "--wallet" , "/wallet" ] , "The path of the neo3 wallet [*.json]." ) ,
2828 new Option < string > ( [ "-p" , "--password" , "/password" ] , "Password to decrypt the wallet, either from the command line or config file." ) ,
29+ new Option < bool > ( [ "--background" , "/background" ] , "Run the service in background." ) ,
2930 new Option < string > ( [ "--db-engine" , "/db-engine" ] , "Specify the db engine." ) ,
3031 new Option < string > ( [ "--db-path" , "/db-path" ] , "Specify the db path." ) ,
3132 new Option < string > ( [ "--noverify" , "/noverify" ] , "Indicates whether the blocks need to be verified when importing." ) ,
@@ -72,7 +73,9 @@ private static void CustomProtocolSettings(CommandLineOptions options, ProtocolS
7273
7374 private static void CustomApplicationSettings ( CommandLineOptions options , Settings settings )
7475 {
75- var tempSetting = string . IsNullOrEmpty ( options . Config ) ? settings : new Settings ( new ConfigurationBuilder ( ) . AddJsonFile ( options . Config , optional : true ) . Build ( ) . GetSection ( "ApplicationConfiguration" ) ) ;
76+ var tempSetting = string . IsNullOrEmpty ( options . Config )
77+ ? settings
78+ : new Settings ( new ConfigurationBuilder ( ) . AddJsonFile ( options . Config , optional : true ) . Build ( ) . GetSection ( "ApplicationConfiguration" ) ) ;
7679 var customSetting = new Settings
7780 {
7881 Logger = tempSetting . Logger ,
0 commit comments