Skip to content

Commit 0038d6f

Browse files
Gchuchuccmywish
authored andcommitted
Add completion feature when build chsrc
1 parent 7a4bf4f commit 0038d6f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ clean-deb:
219219
install: $(ReleaseMode-Target-Name)
220220
install -D -m 755 $(ReleaseMode-Target-Name) $(DESTDIR)/usr/bin/chsrc
221221
install -D -m 644 doc/chsrc.1 $(DESTDIR)/usr/share/man/man1/chsrc.1
222+
install -D -m 644 tool/completion/bash_completion.sh $(DESTDIR)/usr/share/bash-completion/completions/chsrc
222223

223224
# 这样还是太麻烦,不用,我们还是靠 just 来调用吧
224225
#

pkg/deb/debian/postinst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ case "$1" in
2525
chmod +x /usr/bin/chsrc
2626

2727
echo "chsrc has been successfully installed!"
28+
echo "Please restart your terminal or open a new terminal to enjoy autocompletion"
2829
echo "Run 'chsrc help' to get started."
2930
;;
3031

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
# --------------------------------------------------------------
44
# Build File : chsrc_completion.sh
55
# File Authors : 郭恒 <2085471348@qq.com>
6-
#
6+
# Contributors : Nil Null <nil@null.org>
7+
# |
78
# Created On : <2026-03-19>
8-
# Last Modified : <2026-03-20>
9-
# ==============================================================================
9+
# Last Modified : <2026-03-21>
10+
#
11+
# ------------------------------------------------------------------------------
1012
# chsrc 的 Bash 自动补全脚本(当前仅在Linux Ubuntu中测试过)
1113
#
1214
# 目标操作系统:Linux
1315
#
16+
# @issue https://github.com/RubyMetric/chsrc/issues/204
1417
# source chsrc_completion.sh # 当前终端立即生效
15-
# ==============================================================================
18+
# ------------------------------------------------------------------------------
1619

1720
_chsrc() {
1821

0 commit comments

Comments
 (0)