/** * Constructs an argument parser from a POSIX-style help message. * * @param stream * a UTF-8 encoded stream containing a POSIX-style help message * @throws DocoptLanguageError * if the help message is malformed * @see Docopt */ public Docopt(final InputStream stream) { this(read(stream)); }
/** * Constructs an argument parser from a POSIX-style help message. * * @param stream * a UTF-8 encoded stream containing a POSIX-style help message * @throws DocoptLanguageError * if the help message is malformed * @see Docopt */ public Docopt(final InputStream stream) { this(read(stream)); }
static String read(final InputStream stream) { return read(stream, "UTF-8"); }
/** * If set to a non-{@code null} value, the {@code --version} option will be * cause the parser to display the specified string and exit. * * @param stream * a UTF-8 encoded stream to read containing the version * information * @return this object */ public Docopt withVersion(final InputStream stream) { this.version = read(stream); return this; }
/** * If set to a non-{@code null} value, the {@code --version} option will be * cause the parser to display the specified string and exit. * * @param stream * a UTF-8 encoded stream to read containing the version * information * @return this object */ public Docopt withVersion(final InputStream stream) { this.version = read(stream); return this; }
static String read(final InputStream stream) { return read(stream, "UTF-8"); }
/** * If set to a non-{@code null} value, the {@code --version} option will be * cause the parser to display the specified string and exit. * * @param stream * a stream to read containing the version information * @param charset * the character encoding of {@code stream} * @return this object */ public Docopt withVersion(final InputStream stream, final Charset charset) { this.version = read(stream, charset.displayName()); return this; }
/** * Constructs an argument parser from a POSIX-style help message. * * @param stream * a stream containing a POSIX-style help message * @param charset * the character encoding of the stream * @throws DocoptLanguageError * if the help message is malformed * @see Docopt */ public Docopt(final InputStream stream, final Charset charset) { this(read(stream, charset.displayName())); }
/** * Constructs an argument parser from a POSIX-style help message. * * @param stream * a stream containing a POSIX-style help message * @param charset * the character encoding of the stream * @throws DocoptLanguageError * if the help message is malformed * @see Docopt */ public Docopt(final InputStream stream, final Charset charset) { this(read(stream, charset.displayName())); }
/** * If set to a non-{@code null} value, the {@code --version} option will be * cause the parser to display the specified string and exit. * * @param stream * a stream to read containing the version information * @param charset * the character encoding of {@code stream} * @return this object */ public Docopt withVersion(final InputStream stream, final Charset charset) { this.version = read(stream, charset.displayName()); return this; }