Add completion feature when build chsrc

This commit is contained in:
Gchuchu authored and 曾奥然 committed 2026-03-23 19:51:52 +08:00
1 parent 7a4bf4f8aa
commit 0038d6f0a7
3 files changed
+9 -4

No files matched your search

+1
View File
@@ -219,6 +219,7 @@ clean-deb:
install: $(ReleaseMode-Target-Name)
install -D -m 755 $(ReleaseMode-Target-Name) $(DESTDIR)/usr/bin/chsrc
install -D -m 644 doc/chsrc.1 $(DESTDIR)/usr/share/man/man1/chsrc.1
install -D -m 644 tool/completion/bash_completion.sh $(DESTDIR)/usr/share/bash-completion/completions/chsrc
# 这样还是太麻烦,不用,我们还是靠 just 来调用吧
#
+1
View File
@@ -25,6 +25,7 @@ case "$1" in
chmod +x /usr/bin/chsrc
echo "chsrc has been successfully installed!"
echo "Please restart your terminal or open a new terminal to enjoy autocompletion"
echo "Run 'chsrc help' to get started."
;;
@@ -3,16 +3,19 @@
# --------------------------------------------------------------
# Build File : chsrc_completion.sh
# File Authors : 郭恒 <2085471348@qq.com>
#
# Contributors : Nil Null <nil@null.org>
# |
# Created On : <2026-03-19>
# Last Modified : <2026-03-20>
# ==============================================================================
# Last Modified : <2026-03-21>
#
# ------------------------------------------------------------------------------
# chsrc 的 Bash 自动补全脚本(当前仅在Linux Ubuntu中测试过)
#
# 目标操作系统:Linux
#
# @issue https://github.com/RubyMetric/chsrc/issues/204
# source chsrc_completion.sh # 当前终端立即生效
# ==============================================================================
# ------------------------------------------------------------------------------
_chsrc() {