Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In CmdLineParser the parse function accepts OutputStream but the usage shows parse(System.err) #149

Open
kishore25kumar opened this issue Apr 26, 2017 · 1 comment

Comments

@kishore25kumar
Copy link

The signature of the parse function is void parse(OutputStream out) and in CmdLineParser a writer is created using the output stream. In the usage, you are showing to use parse(System.err). System.err is an instance of PrintStream. Why can't the parse function directly use PrintStream directly? It is easy to subclass a print stream and pass it to parse instead of OutPutStream which need to handle bytes and flush functionality.

gaul added a commit to gaul/s3proxy that referenced this issue May 6, 2017
args4j inconsistently uses both methods for output.  Workaround for
kohsuke/args4j#149.
gaul added a commit to gaul/s3proxy that referenced this issue May 8, 2017
args4j inconsistently uses both methods for output.  Workaround for
kohsuke/args4j#149.
@devconsole
Copy link

class PrintStream extends FilterOutputStream [ extends OutputStream ]

This means that any PrintStream is also an OutputStream. Therefore any PrintStream can be used with parse(OutputStream out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants