public static void main ( final String [ ] args ) { EnvironmentInformation . logEnvironmentInfo ( LOG , "Command Line Client" , args ) ; // 1. find the configuration directory final String configurationDirectory = getConfigurationDirectoryFromEnv ( ) ; // 2. load the global configuration final Configuration configuration = GlobalConfiguration . loadConfiguration ( configurationDirectory ) ; // 3. load the custom command lines final List < CustomCommandLine < ? > > customCommandLines = loadCustomCommandLines ( configuration , configurationDirectory ) ; try { final CliFrontend cli = new CliFrontend ( configuration , customCommandLines ) ; SecurityUtils . install ( new SecurityConfiguration ( cli . configuration ) ) ; int retCode = SecurityUtils . getInstalledContext ( ) . runSecured ( ( ) -> cli . parseParameters ( args ) ) ; System . exit ( retCode ) ; } catch ( Throwable t ) { final Throwable strippedThrowable = ExceptionUtils . stripException ( t , UndeclaredThrowableException . class ) ; LOG . error ( "Fatal error while running command line interface." , strippedThrowable ) ; strippedThrowable . printStackTrace ( ) ; System . exit ( 31 ) ; } }
Submits the job based on the arguments .