-
Notifications
You must be signed in to change notification settings - Fork 390
refactor: public config variable naming changes #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Here's a few initial bits to start the work and to see how it'd look like. This does not address the publicity part yet; arguably at least the This also does not mark any of the changes implemented yet as breaking even though strictly speaking, the xinetd and tar ones kind of would be. But those were never intended to be user settable under normal operation, and I doubt renaming them would cause any real world problems. Then again if we end up making some "really" breaking changes elsewhere which would warrant major version bump per semver, we could mark these as such as well. |
bd67d58
to
2bf536d
Compare
Should be rebased on top of #728 when that's in. |
This was never intended to be a public user settable variable, but exists just for test suite mocking purposes.
This is not intended for users to set in order to control completion behavior, but rather for internal/dev-like testing. Therefore `_comp_cmd_*` seems more appropriate.
For consistency with other internal state variables.
For consistency. Previous names were `BASHCOMP_*`, but that prefix is on its way out.
The old variable name is still used as the (undocumented) fallback. It is now made sure to be at the default in the test suite, too.
The old name still serves as the (undocumented) fallback. While at it, verify both names are at their defaults for tests.
The old name still serves as the (undocumented) fallback.
The old name still serves as the (undocumented) fallback.
`COMP_TAR_INTERNAL_PATHS` still serves as the (undocumented) fallback.
`COMP_KNOWN_HOSTS_WITH_HOSTFILE` still serves as the (undocumented) fallback.
`COMP_KNOWN_HOSTS_WITH_AVAHI` still serves as the (undocumented) fallback.
fdf8f55
to
2070c2a
Compare
Per naming guideline for non-local internal variables. #539 (comment)
Per naming guideline for non-local internal variables. #539 (comment)
Per naming guideline for non-local internal variables. #539 (comment)
This is now in sync with the current proposal at #539 (comment). Target branch is docs/markdown, with the intent that this will be merged to master after the markdown branch is in, not to the markdown branch before that. Therefore draft status for now, although I consider this complete for changes touching public configuration/control variables, internal ones should be done in another PR to keep size at bay. |
# `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. | ||
if [[ -n ${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} ]]; then | ||
# `BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. | ||
if [[ -n ${BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE-${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1}} ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -n ${BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE-${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1}} ]]; then | |
if [[ ${BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE-${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1}} ]]; then |
I think this is more consistent with other cases.
# passwordless access to the remote repository | ||
if [[ -n ${COMP_CVS_REMOTE:-} ]]; then | ||
if [[ -n ${BASH_COMPLETION_CMD_CVS_REMOTE-${COMP_CVS_REMOTE-}} ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -n ${BASH_COMPLETION_CMD_CVS_REMOTE-${COMP_CVS_REMOTE-}} ]]; then | |
if [[ ${BASH_COMPLETION_CMD_CVS_REMOTE-${COMP_CVS_REMOTE-}} ]]; then |
@@ -634,7 +635,8 @@ _filedir() | |||
IFS=$'\n' | |||
|
|||
# Try without filter if it failed to produce anything and configured to | |||
[[ -n ${COMP_FILEDIR_FALLBACK-} && -n $arg && ${#toks[@]} -lt 1 ]] && { | |||
[[ ${BASH_COMPLETION_FILEDIR_FALLBACK-${COMP_FILEDIR_FALLBACK-}} && | |||
-n $arg && ${#toks[@]} -lt 1 ]] && { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-n $arg && ${#toks[@]} -lt 1 ]] && { | |
$arg && ${#toks[@]} -lt 1 ]] && { |
@@ -623,7 +623,8 @@ _filedir() | |||
# the fallback condition with the "plus" dirs. | |||
local opts=(-f -X "$xspec") | |||
[[ $xspec ]] && plusdirs=(-o plusdirs) | |||
[[ ${COMP_FILEDIR_FALLBACK-} || -z ${plusdirs-} ]] || | |||
[[ ${BASH_COMPLETION_FILEDIR_FALLBACK-${COMP_FILEDIR_FALLBACK-}} || | |||
-z ${plusdirs-} ]] || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-z ${plusdirs-} ]] || | |
! ${plusdirs-} ]] || |
It seems there are more cases [[ ! $word ]]
(5 cases in bash_completion
) than [[ -z $word ]]
(2 cases). Another instance of -z
is in line bash_completion:1990
(_cd
).
Thanks for having a look and good point on the suggestions. However, we have a lot of similar cases in |
Thanks! |
Implementation of variable naming changes discussed in #537 and #539