feat: add partial flag support to fish and zsh completions

This commit is contained in:
Ray Shirohara 2025-03-11 00:41:19 +09:00
parent 8631279352
commit 80c4db33fd
No known key found for this signature in database
GPG key ID: A0ED68AB35B8627F
2 changed files with 6 additions and 0 deletions

View file

@ -36,6 +36,11 @@ complete -c ghq -n '__fish_seen_subcommand_from get' -l no-recursive -d 'Prevent
complete -c ghq -n '__fish_seen_subcommand_from get' -s b -l branch -d 'Specify branch name. This flag implies --single-branch on Git'
complete -c ghq -n '__fish_seen_subcommand_from get' -s P -l parallel -d 'Import parallelly'
complete -c ghq -n '__fish_seen_subcommand_from get' -l bare -d 'Do a bare clone'
function __complete_get_partial
printf '%s\t%s\n' 'blobless' 'Do a blobless clone'
printf '%s\t%s\n' 'treeless' 'Do a treeless clone'
end
complete -c ghq -n '__fish_seen_subcommand_from get' -l partial -d 'Do a partial clone' -xa '(__complete_get_partial)'
complete -c ghq -n '__fish_seen_subcommand_from list' -s e -l exact -d 'Perform an exact match'
complete -c ghq -n '__fish_seen_subcommand_from list' -l vcs -d 'Specify vcs backend for matching'

View file

@ -27,6 +27,7 @@ function _ghq () {
'--bare[Do a bare clone]' \
'(-b --branch)'{-b,--branch}'[Specify branch name]' \
'(-P --parallel)'{-P,--parallel}'[Import parallelly]' \
'--partial[Do a partial clone]: :(blobless treeless)' \
'(-)*:: :->null_state' \
&& ret=0
;;