shopt-option

progcomp shell option

Enables programmable completion specifications. Register a specification with complete; disabling progcomp does not delete the registered definitions. The fixture checks registration and toggle state; the COMP_* examples exercise actual Tab completion. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): spec retained.

Formal Syntax & Structure

bash syntaxbash
shopt -s progcomp; shopt -u progcomp

Return Value

exit status

Returns zero on success and nonzero on failure; option queries return zero when enabled.

Working Example

Example Snippetbash
complete -W 'alpha beta' bm_demoshopt -s progcompshopt -q progcomp || exit 1shopt -u progcompif shopt -q progcomp; then exit 1; ficomplete -p bm_demo | grep -Fq 'alpha beta' || exit 1printf 'spec retained\n'
Bash Reference