public static void main ( String [ ] args ) { try { int commandIndex = findCommandIndex ( args ) ; if ( commandIndex < 0 ) { printHelp ( ) ; } String [ ] launcherArgs = extractLauncherArgs ( args , commandIndex ) ; String [ ] commandArgs = extractCommandArgs ( args , commandIndex ) ; parseCommandLineArguments ( launcherArgs ) ; debug ( "Launcher#main(): args = " + Arrays . asList ( args ) ) ; debug ( "Launcher#main(): launcherArgs = " + Arrays . asList ( launcherArgs ) ) ; debug ( "Launcher#main(): commandArgs = " + Arrays . asList ( commandArgs ) ) ; String commandName = args [ commandIndex ] ; Executable tool = Command . getUtil ( commandName ) ; if ( tool != null ) { tool . execute ( commandArgs , debugEnabled , quiet ) ; } else { debug ( "Launcher#main(): Command \"" + commandName + "\" not found" ) ; printHelp ( ) ; } } catch ( Throwable t ) { debug ( "Launcher#main(): Throwable caught with message = " + t . getMessage ( ) , t ) ; Utils . exitWithFailure ( "Unexpected throwable" , t ) ; } }
The entry point of the application .