this attempts to explain why $split && return
diff --git a/doc/styleguide.txt b/doc/styleguide.txt index 3391970..85e6d6b 100644 --- a/doc/styleguide.txt +++ b/doc/styleguide.txt @@ -106,3 +106,14 @@ COMPREPLY. COMPREPLY=( ... -- $cur ) or COMPREPLY=( ... -- "$cur" ) ? ---------------------------------------------------------- + +$split && return +---------------- +Should be used in completions using the -s flag of _init_completion, +after $prev has been managed but before $cur is considered. +Rationale: -s flag calls _split_longopt() which attempt to split $cur. +$split = 0 means: +- $cur was actually split (during _init_completion()) +- _split_longopt() actually split $cur into $prev=--* and $cur=<something> +- the value of $cur within the completion is rather non-significant outside +the context of $prev.
_______________________________________________ Bash-completion-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-devel
