getopt(): Update comments about missing functionality

Per the Linux man page, "By default, getopt() permutes the contents of argv as it scans, so that eventually all the nonoptions are at the end."  This behavior, however, is not implemented in the NuttX getopt() logic.
This commit is contained in:
Gregory Nutt 2021-04-04 13:47:39 -06:00 committed by Abdelatif Guettouche
parent e7dffdf06f
commit a0f9da20a2
2 changed files with 7 additions and 1 deletions

View File

@ -64,7 +64,10 @@
* -1 is returned. As a result, your command line parsing loops * -1 is returned. As a result, your command line parsing loops
* must call getopt() repeatedly and continue to parse if other * must call getopt() repeatedly and continue to parse if other
* errors are returned ('?' or ':') until getopt() finally returns -1. * errors are returned ('?' or ':') until getopt() finally returns -1.
* (You can also set optind to -1 to force a reset). * (You can also set optind to -1 to force a reset).
* 4. Standard getopt() permutes the contents of argv as it scans, so that
* eventually all the nonoptions are at the end. This implementation
* does not do this.
* *
* Returned Value: * Returned Value:
* If an option was successfully found, then getopt() returns the option * If an option was successfully found, then getopt() returns the option

View File

@ -327,6 +327,9 @@ errout:
* must call getopt() repeatedly and continue to parse if other * must call getopt() repeatedly and continue to parse if other
* errors are returned ('?' or ':') until getopt() finally returns -1. * errors are returned ('?' or ':') until getopt() finally returns -1.
* (You can also set optind to -1 to force a reset). * (You can also set optind to -1 to force a reset).
* 4. Standard getopt() permutes the contents of argv as it scans, so that
* eventually all the nonoptions are at the end. This implementation
* does not do this.
* *
* Returned Value: * Returned Value:
* If an option was successfully found, then getopt() returns the option * If an option was successfully found, then getopt() returns the option