public int runAndHandleErrors(String... args) {
		String[] argsWithoutDebugFlags = removeDebugFlags(args);
		boolean debug = argsWithoutDebugFlags.length != args.length;
		if (debug) {
			System.setProperty("debug", "true");
		}
		try {
			ExitStatus result = run(argsWithoutDebugFlags);
			// The caller will hang up if it gets a non-zero status
			if (result != null && result.isHangup()) {
				return (result.getCode() > 0) ? result.getCode() : 0;
			}
			return 0;
		}
		catch (NoArgumentsException ex) {
			showUsage();
			return 1;
		}
		catch (Exception ex) {
			return handleError(debug, ex);
		}
	}
public int runAndHandleErrors ( String ... args ) { String [ ] argsWithoutDebugFlags = removeDebugFlags ( args ) ; boolean debug = argsWithoutDebugFlags . length != args . length ; if ( debug ) { System . setProperty ( "debug" , "true" ) ; } try { ExitStatus result = run ( argsWithoutDebugFlags ) ; if ( result != null && result . isHangup ( ) ) { return ( result . getCode ( ) > 0 ) ? result . getCode ( ) : 0 ; } return 0 ; } catch ( NoArgumentsException ex ) { showUsage ( ) ; return 1 ; } catch ( Exception ex ) { return handleError ( debug , ex ) ; } }
Run the appropriate and handle and errors.
@param args the input arguments
@return a return status code (non boot is used to indicate an error)