@@ -55,15 +55,14 @@ public static void main(String[] args) {
55
55
final Schema schema = schemaMap .get (schemaName );
56
56
final String command = CLIHelper .getCommand (schemaName , schema );
57
57
final Map <String , Schema > schemaProperties = schema .getProperties ();
58
- if (schemaProperties == null || schemaProperties .isEmpty ()) {
59
- LOGGER .warn (String .format ("there are not options for command '%s'" , command ));
60
- continue ;
61
- }
58
+ final Subparser parser = subparsers .addParser (command ).help (command );
62
59
63
60
commandMap .put (command , schema );
64
61
65
- final Subparser parser = subparsers .addParser (command ).help (command );
66
-
62
+ if (schemaProperties == null || schemaProperties .isEmpty ()) {
63
+ LOGGER .debug (String .format ("there are not options for command '%s'" , command ));
64
+ continue ;
65
+ }
67
66
for (String propertyName : schemaProperties .keySet ()) {
68
67
final Schema property = schemaProperties .get (propertyName );
69
68
final Map <String , Object > extensions = property .getExtensions ();
@@ -114,18 +113,11 @@ public static void main(String[] args) {
114
113
115
114
BeanUtils .populate (commandObject , optionValueMap );
116
115
if (commandObject instanceof Runnable ) {
117
- System .out .println ("time to run boy..." );
118
- ((Runnable ) commandObject ).run ();
116
+ new Thread (((Runnable ) commandObject )).start ();
119
117
}
120
118
121
- } catch (ClassNotFoundException e ) {
122
- LOGGER .error (String .format ("Could not load class '%s' for command '%s'" , className , userInputCommand ));
123
- } catch (IllegalAccessException e ) {
124
- e .printStackTrace ();
125
- } catch (InstantiationException e ) {
126
- e .printStackTrace ();
127
- } catch (InvocationTargetException e ) {
128
- e .printStackTrace ();
119
+ } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | InvocationTargetException ex ) {
120
+ LOGGER .error (String .format ("Could not load class '%s' for command '%s'" , className , userInputCommand ), ex );
129
121
}
130
122
}
131
123
}
0 commit comments