We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ab05bf commit 88c671aCopy full SHA for 88c671a
completions/tar
@@ -696,16 +696,25 @@ _posix_tar()
696
697
_tar()
698
{
699
- local cmd=${COMP_WORDS[0]} line
+ local cmd=${COMP_WORDS[0]} func line
700
read line <<<"$($cmd --version)"
701
case "$line" in
702
*GNU*)
703
- _gtar "$@"
+ func=_gtar
704
;;
705
*)
706
- _posix_tar "$@"
+ func=_posix_tar
707
708
esac
709
+ $func "$@"
710
+
711
+ # Install real completion for subsequent completions
712
+ if [ -n "${COMP_TAR_INTERNAL_PATHS:-}" ]; then
713
+ complete -F $func -o dirnames tar
714
+ else
715
+ complete -F $func tar
716
+ fi
717
+ unset -f _tar
718
}
719
720
0 commit comments