# Module: `awful.completion`

Helper utilities for bash-like completion lists.

This module store a set of function using shell to complete commands name.

### Info:

- Copyright: 2008 Julien Danjou, Sébastien Gross
- Originally authored by: Julien Danjou <julien@danjou.info>,Sébastien Gross <seb-awesome@chezwam.org>
  (Full contributors list available on our github project)

## Static module functions

awful.completion.bashcomp_load (src) | Enable programmable bash completion in awful.completion.bash at the price of a slight overhead. |
awful.completion.shell (command, cur_pos, ncomp, shell) -> (string, number, table) | Use shell completion system to complete commands and filenames. |
awful.completion.generic (text, cur_pos, ncomp, keywords) -> (string, number, table) | Run a generic completion. |

## Static module functions

🔗 awful.completion.bashcomp_load (src)
  Enable programmable bash completion in awful.completion.bash at the price of a slight overhead.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  src |  | string | The bash completion source file, `/etc/bash_completion` by default.

🔗 awful.completion.shell (command, cur_pos, ncomp, shell) -> (string, number, table)
  Use shell completion system to complete commands and filenames.

  ### Parameters:

  Name |  | Type(s) | Description | Default value
  --- | --- | --- | --- | ---
  command |  | string | The command line. | Not applicable
  cur_pos |  | number | The cursor position. | Not applicable
  ncomp |  | number | The element number to complete. | Not applicable
  shell | Optional | string | The shell to use for completion. Supports "bash" and "zsh". | `based on SHELL`

  ### Returns:

  1. string The new command.
  2. number The new cursor position.
  3. table The table with all matches.
🔗 awful.completion.generic (text, cur_pos, ncomp, keywords) -> (string, number, table)
  Run a generic completion. For this function to run properly the awful.completion.keyword table should be fed up with all keywords. The completion is run against these keywords.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  text |  | string | The current text the user had typed yet.
  cur_pos |  | number | The current cursor position.
  ncomp |  | number | The number of yet requested completion using current text.
  keywords |  | table | The keywords table uised for completion.

  ### Returns:

  1. string The new match.
  2. number The new cursor position.
  3. table The table of all matches.

generated by LDoc 1.5.0