From 34540346d78312a63eeea1b7c3356337ab592a98 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 27 Dec 2021 19:56:28 +0900 Subject: [PATCH] docs(styleguide): fix asciidoc format --- doc/styleguide.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/styleguide.txt b/doc/styleguide.txt index 629a60a021c..36487ac3684 100644 --- a/doc/styleguide.txt +++ b/doc/styleguide.txt @@ -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