args - Textadept API

# Textadept

- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List

# args

Processes command line arguments for Textadept.

## Arg Events

- `'arg_none'` Emitted when no command line arguments are passed to Textadept on startup.

## Functions

### `process`(arg)

Processes command line argument table arg, handling switches previously defined using `args.register()` and treating unrecognized arguments as filenames to open. Emits an `'arg_none'` event when no arguments are present.

Parameters:

- `arg`: Argument table.

See also:

- `register`
- `events`

### `register`(short, long, narg, f, description)

Registers a command line switch with short and long versions short and long, respectively. narg is the number of arguments the switch accepts, f is the function called when the switch is tripped, and description is the switch’s description when displaying help.

Parameters:

- `short`: The string short version of the switch.
- `long`: The string long version of the switch.
- `narg`: The number of expected parameters for the switch.
- `f`: The Lua function to run when the switch is tripped.
- `description`: The string description of the switch for command line help.