diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-11-01 19:26:53 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2010-11-01 19:29:45 +0200 |
commit | 0f450219b667ec5f8d951b0c41593c7b983e2ada (patch) | |
tree | 054f929068849317af412dc94e9db23db437fa7b /doc | |
parent | 494c44f5a36d29955f46efe2289d0f945a8039c5 (diff) | |
download | bash-completion-0f450219b667ec5f8d951b0c41593c7b983e2ada.tar.gz |
Remove most "-o filenames" options to "complete".
Turn it on dynamically when needed instead; see doc/styleguide.txt for
a longer explanation. This fixes many non-filename completions which
had been previously more or less broken due to unwanted
escape-as-filenames behavior.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/styleguide.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/styleguide.txt b/doc/styleguide.txt index 4dbd5732..24f28636 100644 --- a/doc/styleguide.txt +++ b/doc/styleguide.txt @@ -54,6 +54,18 @@ is preferable because anyone, with any keyboard layout, is able to type it. Backticks aren't always available, without doing strange key combinations. +-o filenames +------------ + +As a rule of thumb, do not use "complete -o filenames". Doing it makes +it take effect for all completions from the affected function, which +may break things if some completions from the function must not be +escaped as filenames. Instead, use the _compopt_o_filenames function +to turn on "-o filenames" behavior dynamically when returning +completions that 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. + ///////////////////////////////////////// case/esac vs if --------------- |