[feature]添加运行时模板 CLI 自动补全#229
Closed
fatsheep2 wants to merge 2 commits into
Closed
Conversation
Member
|
35 万行,需要这么多代码么,害怕 |
Contributor
Author
+349,046 是jieba分词的那个dict.txt文件,之前的那个不知道为什么有问题了,我重新拉了一份结果成diff了 |
d0198ee to
7c06095
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
为运行时模板相关 CLI 增加 shell 自动补全能力,包括:
completion [bash|zsh|powershell]子命令import、config init、template等命令补充模板引用、版本、文件类型和输出格式补全cobra以使用新版 completion APIMotivation and Context
运行时模板会引入模板 ID、版本号、规则文件和输出目标等参数。自动补全可以降低命令行使用成本,尤其是模板版本 pinning 和个人规则文件路径场景。
Dependencies
github.com/spf13/cobra到v1.10.2go mod tidy更新Type of change
How has this been tested?
make check-formatgo test ./pkg/cmd ./pkg/importerIs this change properly documented?
自动补全作为 CLI 易用性增强,建议在核心模板 provider PR 合并后,在使用文档中补充一小段
completion命令示例。