File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 11# API and naming
22
3+ ## General API conventions
4+
5+ Most of the functions in bash-completion generate completions and directly
6+ inject them to the ` COMPREPLY ` array variable, as required for completions to
7+ work.
8+
9+ Most other functions make use of "output" variables, i.e. assign values to
10+ them. The most common one of these is named ` ret ` . Consult the commentary
11+ before each function in the source to find out the specific names.
12+ ` local ` izing output variables before invoking a function that populates them
13+ is the caller's responsibility.
14+ Note that if calling multiple functions that assign output to the same variable
15+ during one completion function run, each result should be copied to another
16+ variable between the calls to avoid it possibly being overwritten and lost on
17+ the next call. Also, the variables should also be ensured to be clear before
18+ each call, typically by ` unset -v ` ing them when multiple such calls are used,
19+ to avoid them interfering with each other.
20+
21+ ## Naming
22+
323Due to its nature, bash-completion adds a number of functions and variables in
424the shell's environment.
525
You can’t perform that action at this time.
0 commit comments