Skip to content
Snippets Groups Projects
Commit d0f841ed authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story 1840. Simplified code.

parent 83def454
Branches
Tags
No related merge requests found
...@@ -200,8 +200,7 @@ public class CmdLineParser ...@@ -200,8 +200,7 @@ public class CmdLineParser
} }
} }
protected boolean isValid(final ArgumentMap am, final PrintStream outStream, protected boolean isValid(final ArgumentMap am) throws UsageException
final PrintStream errStream) throws UsageException
{ {
int count = 0; int count = 0;
...@@ -253,8 +252,6 @@ public class CmdLineParser ...@@ -253,8 +252,6 @@ public class CmdLineParser
if (count == 1) if (count == 1)
{ {
this.command.setSystemOut(outStream);
this.command.setSystemErr(errStream);
return true; return true;
} }
else else
...@@ -285,7 +282,7 @@ public class CmdLineParser ...@@ -285,7 +282,7 @@ public class CmdLineParser
{ {
this.proceed = false; this.proceed = false;
if (!am.isSet("h") && !am.isSet("help") && isValid(am, out, err)) if (!am.isSet("h") && !am.isSet("help") && isValid(am))
{ {
Subject subject = CertCmdArgUtil.initSubject(am, true); Subject subject = CertCmdArgUtil.initSubject(am, true);
...@@ -307,6 +304,10 @@ public class CmdLineParser ...@@ -307,6 +304,10 @@ public class CmdLineParser
throw e; throw e;
} }
} }
// the following statements are executed only when proceed is true
this.command.setSystemOut(out);
this.command.setSystemErr(err);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment