diff --git a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java index f68cfaeac..40389b444 100644 --- a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java +++ b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java @@ -57,6 +57,10 @@ Licensed to the Apache Software Foundation (ASF) under one or more * g: * -g [string] * + * + * h< + * -h [file name] (opens the existing file for reading, the caller must close the stream) + * * * *

diff --git a/src/main/java/org/apache/commons/cli/TypeHandler.java b/src/main/java/org/apache/commons/cli/TypeHandler.java index 4709c7811..402c915f8 100644 --- a/src/main/java/org/apache/commons/cli/TypeHandler.java +++ b/src/main/java/org/apache/commons/cli/TypeHandler.java @@ -36,6 +36,10 @@ Licensed to the Apache Software Foundation (ASF) under one or more * Options with custom converters and/or verifiers, using the default serialization methods, this class should be properly configured with the custom converters * and verifiers for the specific class. *

+ *

+ * The default converter for {@link FileInputStream} opens the named file each time it converts a value, and the caller must close the returned stream. As + * with {@link FileInputStream#FileInputStream(String)}, opening a special file such as a named pipe can block. + *

*/ public class TypeHandler { @@ -206,6 +210,9 @@ public static TypeHandler getDefault() { /** * Returns the opened FileInputStream represented by {@code string}. + *

+ * The caller must close the returned stream. + *

* * @param string The file location. * @return The file input stream represented by {@code string}.