@@ -43,7 +43,7 @@ public void Interpret(string[] args)
4343 if ( parser . ParseArguments ( args , options ) )
4444 {
4545 if ( options == null )
46- Environment . Exit ( Parser . DefaultExitCodeFail ) ;
46+ ExitWithFailure ( "Could not parse arguments." ) ;
4747
4848 if ( ! args . Any ( ) )
4949 PrintInEngineHelpTextAndExit ( plugins , options ) ;
@@ -53,6 +53,7 @@ public void Interpret(string[] args)
5353 if ( options . ShouldRunScheduler )
5454 {
5555 Write . Info ( CliLogo ) ;
56+ Write . Line ( "Starting the scheduler..." ) . Newline ( ) ;
5657 Program . RunScheduler ( ) ;
5758 ExitWithSuccess ( ) ;
5859 }
@@ -87,22 +88,22 @@ public void ExitWithSuccess(string message = null)
8788 if ( string . IsNullOrWhiteSpace ( message ) )
8889 message = "success" ;
8990 Logger . Debug ( $ "✔ { message } ") ;
90- Environment . Exit ( 0 ) ;
91+ Environment . Exit ( ExitCodes . success ) ;
9192 }
9293
9394 public void ExitWithFailure ( string message = null )
9495 {
9596 Logger . Error ( MakeErrorMessage ( message ) ) ;
9697 Write . Error ( message ) ;
97- Environment . Exit ( Parser . DefaultExitCodeFail ) ;
98+ Environment . Exit ( ExitCodes . fail ) ;
9899 }
99100
100101 public void ExitWithFailure ( Exception exception = null )
101102 {
102103 var ex = exception ?? new Exception ( "Unspecified failure" ) ;
103104 Logger . Error ( ex , MakeErrorMessage ( ex . Message ) ) ;
104105 Write . Error ( ex . Message ) ;
105- Environment . Exit ( Parser . DefaultExitCodeFail ) ;
106+ Environment . Exit ( ExitCodes . fail ) ;
106107 }
107108
108109 protected string MakeErrorMessage ( string message = null )
@@ -121,13 +122,10 @@ public void InterpretPluginArguments(string[] pluginArgs, IOptions pluginOptions
121122 if ( subOptions == null && ( lastArg == "-h" || lastArg == "--help" ) )
122123 ExitWithSuccess ( ) ;
123124 else if ( subOptions == null )
124- ExitWithFailure ( new CommandFailedException ( "Could not parse plugin options" ) ) ;
125-
125+ ExitWithFailure ( new CommandFailedException ( "Could not parse plugin arguments. Use -h, --help for usage." ) ) ;
126126 var command = subOptions as ICommand ;
127-
128127 if ( command is AbstractCommand )
129128 ( command as AbstractCommand ) . Name = verb . Normalize ( ) ;
130-
131129 command . Run ( ) ;
132130 ExitWithSuccess ( ) ;
133131 }
@@ -138,7 +136,7 @@ public void InterpretPluginArguments(string[] pluginArgs, IOptions pluginOptions
138136 } ) ;
139137
140138 if ( ! isSuccessful )
141- ExitWithFailure ( "Could not parse plugin arguments" ) ;
139+ ExitWithFailure ( new CommandFailedException ( "Could not parse plugin arguments. Use -h, --help for usage." ) ) ;
142140 }
143141
144142 public void PrintPluginHelpTextAndExit ( Plugin plugin , List < IOptions > pluginOptionList , string [ ] pluginArgs )
0 commit comments