# args

Processes command line arguments for Textadept.

## Arg Events

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

- - -

## Functions

- - -

<a id="process"></a>
### `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`](#register)
* [`events`](#events)

- - -

<a id="register"></a>
### `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.

- - -


