By default, getopt() permutes the contents of argv as it scans, so that eventually all the nonoptions are atthe
end. Two other modes are also implemented.If the first character of optstring is '+' or the environment vari-
able POSIXLY_CORRECT is set, then option processing stops as soon as a nonoption argument is encountered.If the
first character of optstring is '-', then each nonoption argv-element is handled as if it were the argument of an
option with character code 1.(This is used by programs that were written to expect options and otherargv-ele-
mentsinanyorderandthat care about the ordering of the two.)The special argument "--" forces an end of
option-scanning regardless of the scanning mode.
页:
[1]