Skip to content

Commit ca273fc

Browse files
authored
feat: list files when there is no completion on zsh (#21)
1 parent 615ef3d commit ca273fc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/src/install/shell_completion_configuration.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ if type compdef &>/dev/null; then
7474
IFS=\$'\n' reply=(\$(COMP_CWORD="\$((CURRENT-1))" COMP_LINE="\$BUFFER" COMP_POINT="\$CURSOR" $rootCommand completion -- "\${words[@]}"))
7575
IFS=\$si
7676
77-
_describe 'values' reply
77+
if [[ -z "\$reply" ]]; then
78+
_path_files
79+
else
80+
_describe 'values' reply
81+
fi
7882
}
7983
compdef _${rootCommand}_completion $rootCommand
8084
fi

test/src/install/shell_completion_configuration_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ if type compdef &>/dev/null; then
3636
IFS=\$'\n' reply=(\$(COMP_CWORD="\$((CURRENT-1))" COMP_LINE="\$BUFFER" COMP_POINT="\$CURSOR" very_good completion -- "\${words[@]}"))
3737
IFS=\$si
3838
39-
_describe 'values' reply
39+
if [[ -z "\$reply" ]]; then
40+
_path_files
41+
else
42+
_describe 'values' reply
43+
fi
4044
}
4145
compdef _very_good_completion very_good
4246
fi

0 commit comments

Comments
 (0)