Bash Completion Team
Proposal: ''New Directory Layout''
Proposal #1
Drafter: David Paleino
Date: 2009-02-06
- Comments:
- rename all environment variables from $BASH_COMPLETION_* to $COMP_*
- how/where to handle enabled/disabled completions? Using $COMP_*CONF ? Using symlinks? If using symlinks, see $COMP_ENABLED_DIR
please remember this is a draft. Everything can be discussed and changed.
removed /usr/share/bash-completion/enabled in favour of /etc/bash_completion.d (?ColdWind)
/usr/share/bash-completion/base ($COMP_BASE)
- The core completions. _cd(), _expand(), _get_cword() and the such would all go here.
- What would remain of current bash_completion after splitting off all extraneous third-party completions.
- Uses values from $COMP_CONF and $COMP_USER_CONF (if enabled)
- Would load completions from $COMP_PATH.
/usr/share/bash-completion/completions/ ($COMP_DIR)
- What we now have in contrib/
- Ideally, completions should be maintained upstream, so we wouldn't install anything here. But this isn't an ideal world, and most files from this directory will probably belong to us.
/etc/bash_completion ($COMP_COMPAT_BASE)
- For backwards-compatibility, would just source $COMP_BASE.
/etc/bash_completion.d/ ($COMP_ENABLED_DIR)
- For backwards-compatibility, would source completions from here.
- Enabled completions have a symlink to them on this directory.
- We may issue a warning if people put completions here directly instead of symlinks.
/etc/bash_completion.conf ($COMP_CONF)
- New file
- System-wide (also: per-distribution) configuration file:
- $COMP_PATH: colon-separated list of additional paths to look for completions
- $COMP_DIR: see above section
- $COMP_ENABLED_DIR: see above section
- $COMP_COMPAT_DIR: see above section
- $COMP_USER_ENABLED: whether to enable the use of per-user completions, $COMP_USER_CONF and $COMP_USER_DIR -- we could also decide to avoid this, and let the user do what she wants always.
~/.bash_completion ($COMP_USER_CONF)
- New file
- Per-user configuration file. Same as $COMP_CONF, should be loaded after it.
~/.bash_completion.d/ ($COMP_USER_DIR)
- New directory
- Per-user completions, should be loaded after those in $COMP_DIR.
- Should decide policy to handle completions name conflicts. Which ones take precedence? These or $COMP_DIR's ones?