FileArgument normally treats pathname components starting with a "-" as invalid pathnames and won't accept them. (The rationale is that they are probably a misplaced or unknown option names.) This behavior can be changed using the {@link #ALLOW_DODGY_NAMES} flag.
Some commands use "-" to denote (for example) "standard input" instead of a file named "-". To support this, FileArgument provides a {@link #HYPHEN_IS_SPECIAL} flag whichsuppresses the {@link Argument#EXISTING} and {@link Argument#NONEXISTENT} flags so thata "-" argument is always accepted. It is up to the command to deal with the resulting {@code File("-")} instance, which of course should not be opened in the normal way.(Note: this is an experimental feature, and may be replaced with a conceptually cleaner solution in the future.) @author crawley@jnode.org
|
|
|
|