From 0f450219b667ec5f8d951b0c41593c7b983e2ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 1 Nov 2010 19:26:53 +0200 Subject: 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. --- doc/styleguide.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') 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 --------------- -- cgit v1.2.1