@@ -47,11 +47,13 @@ private HelpPrinter() {
47
47
48
48
public static void print (final ObjectFactory <?> factory ,
49
49
final PrintStream out ) {
50
- out .println ("WELCOME TO METAFACTURE" );
50
+ out .println ("Welcome to Metafacture" );
51
+ out .println ("======================" );
52
+ out .println ();
51
53
out .println (getVersionInfo ());
52
54
53
55
out .println ("\n Usage:\t flux FLOW_FILE [VARNAME=VALUE ...]\n " );
54
- out .println ("Available pipe elements :\n " );
56
+ out .println ("Available flux commands :\n " );
55
57
56
58
final List <String > keyWords = new ArrayList <String >();
57
59
keyWords .addAll (factory .keySet ());
@@ -75,49 +77,53 @@ private static <T> void describe(String name, ObjectFactory<T> factory,
75
77
final Description desc = moduleClass .getAnnotation (Description .class );
76
78
77
79
out .println (name );
80
+ name .chars ().forEach (c -> {
81
+ out .print ("-" );
82
+ });
83
+ out .println ();
78
84
79
85
if (desc != null ) {
80
- out .println ("description:\t " + desc .value ());
86
+ out .println ("- description:\t " + desc .value ());
81
87
}
82
88
final Collection <String > arguments = getAvailableArguments (moduleClass );
83
89
if (!arguments .isEmpty ()) {
84
- out .println ("argument in \t " + arguments );
90
+ out .println ("- arguments: \t " + arguments );
85
91
}
86
92
87
93
final Map <String , Class <?>> attributes = factory .get (name ).getSetterTypes ();
88
94
89
95
if (!attributes .isEmpty ()) {
90
- out .print ("options:\t " );
96
+ out .print ("- options:\t " );
91
97
final StringBuilder builder = new StringBuilder ();
92
98
for (Entry <String , Class <?>> entry : attributes .entrySet ()) {
93
99
if (entry .getValue ().isEnum ()) {
94
100
builder .append (entry .getKey ())
95
101
.append (" " )
96
- .append (Arrays .toString (entry .getValue ().getEnumConstants ()))
102
+ .append (Arrays .asList (entry .getValue ().getEnumConstants ()))
97
103
.append (", " );
98
104
} else {
99
105
builder .append (entry .getKey ())
100
106
.append (" (" )
101
- .append (entry .getValue ().getName ())
107
+ .append (entry .getValue ().getSimpleName ())
102
108
.append ("), " );
103
109
}
104
110
105
111
}
106
112
out .println (builder .substring (0 , builder .length () - 2 ));
107
113
}
108
114
109
- out .println ("implementation:\t " + moduleClass .getCanonicalName ());
110
115
String inString = "<unknown>" ;
111
116
String outString = "" ;
112
117
final In inClass = moduleClass .getAnnotation (In .class );
113
118
if (inClass != null ) {
114
- inString = inClass .value ().getCanonicalName ();
119
+ inString = inClass .value ().getSimpleName ();
115
120
}
116
121
final Out outClass = moduleClass .getAnnotation (Out .class );
117
122
if (outClass != null ) {
118
- outString = outClass .value ().getCanonicalName ();
123
+ outString = outClass .value ().getSimpleName ();
119
124
}
120
- out .println ("signature:\t " + inString + " -> " + outString );
125
+ out .println ("- signature:\t " + inString + " -> " + outString );
126
+ out .println ("- java class:\t " + moduleClass .getCanonicalName ());
121
127
out .println ();
122
128
}
123
129
0 commit comments