Add cgdb completion

This commit is contained in:
Wu, Zhenyu 2024-05-10 10:16:27 +08:00
parent b1cf651870
commit ea4685a96f
No known key found for this signature in database
GPG Key ID: 0E07E1F8C0EC10AD
1 changed files with 28 additions and 0 deletions

28
src/_cgdb Normal file
View File

@ -0,0 +1,28 @@
#compdef cgdb
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cgdb (https://github.com/cgdb/cgdb).
# Modified from rejected https://github.com/cgdb/cgdb/pull/337/
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Wu, Zhenyu <wuzhenyu@ustc.edu>
#
# ------------------------------------------------------------------------------
# cgdb -- <TAB>
if ((${${words[1, CURRENT]}[(I)--]})) && [[ ${words[CURRENT]} != -- ]]; then
_gdb
# cgdb <TAB> or cgdb <TAB> -- or cgdb --<TAB>
else
_arguments -s \
"(- : *)"{-v,--version}"[Print version information and then exit.]" \
"(- : *)"{-h,--help}"[Print help (this message) and then exit.]" \
-d"[Set debugger to use.]" \
-w"[Wait for debugger to attach before starting.]" \
--
fi