mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
The getopt command uses global variables and is not thread safe. Created a minimal px4_getopt version that supports options with or without an arg, and random placement of options on the command line. This version modifies the order of the args in argv as does the POSIX version of getopt. This assumes that argv[0] is the program name. Nuttx may not support that properly in task_spawn. Signed-off-by: Mark Charlebois <charlebm@gmail.com>