Module argcompat

Hides argument passing differences.

Cynosure 2 passes command arguments as a table, rather than as a set of separate arguments. The Lua REPL included with ULOS 2 manages this; but this module is provided for programs that do not wish to incur the overhead of wrapping themselves in that REPL.

Functions

command (cmd[, ...]) Coerce arguments into a table.


Functions

command (cmd[, ...])
Coerce arguments into a table. The first argument must always be the default name of the command. If the second argument is a table then it is returned as-is; otherwise, all arguments are placed into a table with index 0 being cmd.

Parameters:

  • cmd string The default command name
  • ... Any remaining arguments (optional)

Returns:

    table The arguments as a table

Usage:

    local argv = command("ls", ...)
generated by LDoc 1.4.6 Last updated 2023-03-04 11:42:14