-
Flags
Hi,
why do some man pages recommend using the -- before string flags?
javac -classpath
seems to work fine..
-
Because some few options start with the same single character as string options
-f
--foo
and the commandline interpreter will find -f and -foo to be the same thing.
-
Thanks.. that explains it
-
It actually depends on whether the program uses getopt, getopt_long, getopt_long_only, or its own homegrown routine to parse its command line.
getopt only recognizes single-character options, like -f.
getopt_long recognizes both single-character options, like -f, and their equivalent long versions, like --foo. When the program uses getopt_long, -foo parses as "the -f option, with argument oo".
getopt_long_only doesn't recognize short options at all. -foo and --foo are the same to it.
If the argument-parsing routine is homegrown, then anything goes.
I would actually guess, given the way that Sun does the rest of their JDK (and the fact that a JDK is required to compile the JDK...), that their argument parsing is homegrown. But that's only a guess.
FWIW, most of the X toolkit arguments are single-dash as well (-display is probably the most common, followed by -geometry). I think Xlib uses a homegrown routine as well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|