getoptInorder

getoptInorder is a cover to std.getopt that processes command line options in the order on the command.

This is intended for command line argument processing where the order of arguments on the command line is important. The standard library std.getopt routine processes options in the order listed in call to getopt. Behavioral changes involve order of callback processing and array filling.

Other changes from std.getopt:

  • The std.getopt.config.required option is not supported.
  • Single digits cannot be used as short options. e.g. '-1' cannot be an option.
  • Non-numeric option arguments starting with a dash are not interpreted correctly, unless it looks like a negative number or is a single dash. Some examples, assuming ("--val") takes one argument:
    • ["--val", "-9"] - Okay, "-9" is arg
    • ["--val", "-"] - Okay, "-" is arg
    • ["--val", "-a"] - Not okay, "-a" is treated as separate option.
GetoptResult
getoptInorder
(
T...
)
(
ref string[] args
,)

Meta