gnu-getopt: modernize
gnu-getopt: add test

Closes #35309.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>