Module leste.utils.cli
The cli module provides functions for parsing command-line arguments.
Functions
| removeFlags (args) | Removes flags (arguments starting with "-") from the given table of arguments. |
| getFlags (removeFromArg) | Parses command-line arguments and returns a table containing parsed flags. |
Functions
- removeFlags (args)
-
Removes flags (arguments starting with "-") from the given table of arguments.
Parameters:
- args table The table of arguments to process.
Returns:
-
table
A new table containing only non-flag arguments, can be assigned to the global
argtable. - getFlags (removeFromArg)
-
Parses command-line arguments and returns a table containing parsed flags.
Parameters:
- removeFromArg
boolean
If true, removes parsed flags from the global
argtable. Defaults to false.
Returns:
-
table
A table containing parsed flags:
verbose(boolean): True if the--verboseor-vflag is present.
exitOnFirst(boolean): True if the--exitfirstor-xflag is present. - removeFromArg
boolean
If true, removes parsed flags from the global