3131import org .apache .commons .cli .CommandLine ;
3232import org .apache .commons .cli .CommandLineParser ;
3333import org .apache .commons .cli .DefaultParser ;
34- import org .apache .commons .cli .HelpFormatter ;
3534import org .apache .commons .cli .Option ;
3635import org .apache .commons .cli .Options ;
3736import org .apache .commons .cli .ParseException ;
37+ import org .apache .commons .cli .help .HelpFormatter ;
38+ import org .apache .commons .cli .help .HelpFormatter .Builder ;
3839import org .eclipse .lsp4j .Diagnostic ;
3940import org .eclipse .lsp4j .DiagnosticSeverity ;
4041
@@ -77,7 +78,7 @@ public static void main(String args[])
7778 + default_mode
7879 + "." )
7980 .required (false )
80- .build ();
81+ .get ();
8182 options .addOption (modeOpt );
8283
8384 final EnumSet <MODE > portOptModes = EnumSet .of (MODE .server , MODE .daemon , MODE .client );
@@ -91,7 +92,7 @@ public static void main(String args[])
9192 + collToString (portOptModes )
9293 + "]." )
9394 .required (false )
94- .build ();
95+ .get ();
9596 options .addOption (portOpt );
9697 optModes .put (portOpt .getLongOpt (), portOptModes );
9798
@@ -110,7 +111,7 @@ public static void main(String args[])
110111 + collToString (portOptModes )
111112 + "]" )
112113 .required (false )
113- .build ();
114+ .get ();
114115 options .addOption (formatOption );
115116 optModes .put (formatOption .getLongOpt (), formatOptModes );
116117
@@ -130,7 +131,7 @@ public static void main(String args[])
130131 + collToString (severityOptModes )
131132 + "]" )
132133 .required (false )
133- .build ();
134+ .get ();
134135 options .addOption (severityOption );
135136 optModes .put (severityOption .getLongOpt (), severityOptModes );
136137
@@ -146,7 +147,7 @@ public static void main(String args[])
146147 + collToString (relatedOptModes )
147148 + "]" )
148149 .required (false )
149- .build ();
150+ .get ();
150151 options .addOption (relatedOption );
151152 optModes .put (relatedOption .getLongOpt (), relatedOptModes );
152153
@@ -156,7 +157,7 @@ public static void main(String args[])
156157 .argName ("help" )
157158 .desc ("Print usage information" )
158159 .required (false )
159- .build ();
160+ .get ();
160161 options .addOption (helpOpt );
161162
162163 MODE mode = default_mode ;
@@ -381,9 +382,13 @@ public static void main(String args[])
381382 private static final String APP_NAME = "Ariadne" ;
382383 private static final String APP_DESCRIPTION =
383384 "Ariadne: A Language Server Protocol server and linter for WALA Python/ML analysis" ;
384-
385- private static void printUsage (final Options options ) {
386- final HelpFormatter formatter = new HelpFormatter ();
387- formatter .printHelp (APP_NAME + " [arguments] [filenames]" , APP_DESCRIPTION , options , null );
385+ private static final String APP_FOOTER =
386+ "Please report issues at http://github.com/wala/ML/issues" ;
387+
388+ private static void printUsage (final Options options ) throws IOException {
389+ Builder builder = HelpFormatter .builder ();
390+ final HelpFormatter formatter = builder .get ();
391+ formatter .printHelp (
392+ APP_NAME + " [arguments] [filenames]" , APP_DESCRIPTION , options , APP_FOOTER , false );
388393 }
389394}
0 commit comments