@@ -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." ) , 
@@ -39,6 +40,7 @@ public int OnStartWithCommandLine(string[] args)
3940
4041        private  void  Handle ( RootCommand  command ,  CommandLineOptions  options ,  InvocationContext  context ) 
4142        { 
43+             IsBackground  =  options . Background ; 
4244            Start ( options ) ; 
4345        } 
4446
@@ -72,7 +74,9 @@ private static void CustomProtocolSettings(CommandLineOptions options, ProtocolS
7274
7375        private  static   void  CustomApplicationSettings ( CommandLineOptions  options ,  Settings  settings ) 
7476        { 
75-             var  tempSetting  =  string . IsNullOrEmpty ( options . Config )  ?  settings  :  new  Settings ( new  ConfigurationBuilder ( ) . AddJsonFile ( options . Config ,  optional :  true ) . Build ( ) . GetSection ( "ApplicationConfiguration" ) ) ; 
77+             var  tempSetting  =  string . IsNullOrEmpty ( options . Config ) 
78+                 ?  settings 
79+                 :  new  Settings ( new  ConfigurationBuilder ( ) . AddJsonFile ( options . Config ,  optional :  true ) . Build ( ) . GetSection ( "ApplicationConfiguration" ) ) ; 
7680            var  customSetting  =  new  Settings 
7781            { 
7882                Logger  =  tempSetting . Logger , 
0 commit comments