ULOS Manual Pages - argutil(3) | Back

NAME
  argutil - argument parsing utilities

DESCRIPTION
  argutil provies a generic argument parsing utility for all programs.  It is primarily intended to prevent most programs from requiring their own argument parser.

FUNCTIONS
  parse(...): table, table
    An OpenOS-style argument parser.  For more advanced parsing, see getopt() below.

    parse() sorts the varargs into args and opts, then returns them in that order.  When parse encounters a --, it will stop looking for options and dump any remaining varargs into the args table.

    args is simply an array of arguments;  opts is a map, such that opts[option] = value.

  getopt(opts, ...): table, table
    A more advanced argument processor than parse().

    The opts table must contain one opts table, whose keys are the names of options and whose values are a boolean specifying whether that option takes a single argument.  opts may also specify the exit_on_bad_opt option to exit if an unrecognized option is given, and a allow_finish boolean to allow a -- argument to stop option processing.

COPYRIGHT
  ULOS Core Libraries copyright (c) 2021 Ocawesome101 under the DSLv2.

REPORTING BUGS
  Bugs should be reported at https://github.com/ocawesome101/oc-ulos/issues.