Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/styleguide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ need that kind of processing (e.g. file and command names). The
_filedir and _filedir_xspec helpers do this automatically whenever
they return some completions.

[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
------------------------------------------------
`[[ ${COMPREPLY-} == *= ]] && compopt -o nospace`
-------------------------------------------------

The above is functionally a shorthand for:
----
if [[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]]; then
compopt -o nospace
fi
----

if [[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]]; then
compopt -o nospace
fi

It is used to ensure that long options' name won't get a space
appended after the equal sign. Calling compopt -o nospace makes sense
in case completion actually occurs: when only one completion is
available in COMPREPLY.

$split && return
----------------
`$split && return`
------------------

Should be used in completions using the -s flag of _init_completion,
or other similar cases where _split_longopt has been invoked, after
Expand Down