Bash 补全额外单词 Fedora 23

Bash 补全额外单词 Fedora 23

今天发现dnf搜索TAB时多了一些字。

任何人都知道是什么导致了这种行为?尝试清理所有 dnf,然后重新安装 bash_completion 和 dnf 更新。它不起作用。我在 .bashrc 中添加了一些别名和自定义 bash 提示符 (PS1),其余为默认值。

#dnf searc
a              DNF            is             Please         the
and            documentation  not            'plugins'      The
API            function       of             release.       upcoming
at             functions.     officially     removed        use
available      api.html.      only           search         will
be             in             part           supported

答案1

这是 bash 补全中的一个错误dnf(不是第一个,也不是最后一个)。让我们看看我能找到什么。

运行相同的命令set -x将揭示其来源:

 python3 -c 'import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])' _cmds sear -d 0 -q -C

不返回选项列表,但基本上是一些错误。这是因为/usr/lib/python3.4/site-packages/dnf/cli/completion_helper.py使用了不支持的 API,并且在调试时,我们会看到如下错误:

“插件”功能不是 DNF API 的一部分,将在即将发布的 DNF 版本中删除。请仅使用官方支持的 API 函数。 DNF API 文档位于https://dnf.readthedocs.org/en/latest/api.html

从线

172             base.plugins.load(base.conf.pluginpath, [])

这应该是base.init_plugins()并且已经在最近提交。现在唯一需要做的就是等待它在分发中得到修复。

相关内容