Make all functions in buck-completion.bash usable
Created by: jbriales
Bash completion capabilities are nicely structured into different bash functions in https://github.com/facebook/buck/blob/master/scripts/buck-completion.bash though.
This means completion functions like _buck_completion_try_build
can be easily reused by users/developers for other custom functions beyond buck
.
However the way logging currently works for bash completion,
there is local log=_buck_completion_log
locally defined in _buck_completion_run
.
This means if we call directly e.g. _buck_completion_try_build
, log
will be empty there and logging becomes execution (i.e. everything breaks).
This could be easily fixed by making log an environment variable, and since this is a very common name, we can rename log into sth like LOG_BUCK_COMPLETION
.
If that sounds right, I can do a pull request.