File tree Expand file tree Collapse file tree
java/org/apache/commons/cli2/commandline
test/org/apache/commons/cli2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,8 +117,7 @@ public CommandLine parse(final String[] arguments)
117117 * @return a valid CommandLine or null if the parse was unsuccessful
118118 * @throws IOException if an error occurs while formatting help
119119 */
120- public CommandLine parseAndHelp (final String [] arguments )
121- throws IOException {
120+ public CommandLine parseAndHelp (final String [] arguments ) {
122121 helpFormatter .setGroup (group );
123122
124123 try {
Original file line number Diff line number Diff line change @@ -183,26 +183,21 @@ public void testManualIntroduction() {
183183
184184 ///////////////////////////////////////////////////
185185
186- try {
187- Group options = outputChildren ;
188- HelpFormatter hf = new HelpFormatter ();
189-
190- Parser p = new Parser ();
191- p .setGroup (options );
192- p .setHelpFormatter (hf );
193- p .setHelpTrigger ("--help" );
194- CommandLine cl = p .parseAndHelp (new String []{});
195- if (cl ==null ) {
196- System .exit (-1 );
197- }
198- } catch (IOException e ) {
199- // TODO Auto-generated catch block
200- e .printStackTrace ();
186+ Group options = outputChildren ;
187+ HelpFormatter hf = new HelpFormatter ();
188+
189+ Parser p = new Parser ();
190+ p .setGroup (options );
191+ p .setHelpFormatter (hf );
192+ p .setHelpTrigger ("--help" );
193+ CommandLine cl = p .parseAndHelp (new String []{});
194+ if (cl ==null ) {
195+ System .exit (-1 );
201196 }
202197
203198 //////////////////////////////////////////////////
204199
205- CommandLine cl = new WriteableCommandLineImpl (outputChildren ,new ArrayList ());
200+ cl = new WriteableCommandLineImpl (outputChildren ,new ArrayList ());
206201
207202 // if we have --output option
208203 if (cl .hasOption ("--output" )) {
You can’t perform that action at this time.
0 commit comments