args4j icon indicating copy to clipboard operation
args4j copied to clipboard

Support multi-word and multi-line string options

Open katomaso opened this issue 5 years ago • 2 comments

katomaso avatar Oct 21 '19 15:10 katomaso

This should be handled by the shell running your program. An element of args array coming to main function can contain multi-word (and in fact it will if you pass an argument inside quotes) and multi-line string and args4j probably should not do anything about it.

gagarski avatar Dec 14 '22 22:12 gagarski

PS C:\Users\gagar\IdeaProjects> cat .\ArgsDemo.java
public class ArgsDemo {
    public static void main(String[] args) {
        for (String arg : args) {
            System.out.println(arg);
        }
    }
}
PS C:\Users\gagar\IdeaProjects> java .\ArgsDemo.java hello katomaso
hello
katomaso
PS C:\Users\gagar\IdeaProjects> java .\ArgsDemo.java "hello katomaso" another two arguments
hello katomaso
another
two
arguments

gagarski avatar Dec 14 '22 22:12 gagarski