.bash_completion
changeset 1007 0077617b0deb
parent 972 27754771cbb6
child 1011 48975083716e
--- a/.bash_completion	Fri Dec 23 20:26:07 2022 +0200
+++ b/.bash_completion	Sat Dec 24 13:30:30 2022 +0200
@@ -42,6 +42,23 @@
 }
 complete -F _hgsyncew -o nospace hgsyncew
 
+_hgsync() {
+  local cur=${COMP_WORDS[COMP_CWORD]}
+  case $COMP_CWORD in
+    0|1)
+      COMPREPLY=( $(compgen -W "local remote pull push info --help" -- $cur) )
+      compopt +o nospace
+      return ;;
+    2)
+      COMPREPLY=( $(compgen -d -S / -- "$cur") )
+      return ;;
+    *)
+      COMPREPLY=( )
+      return ;;
+  esac
+}
+complete -F _hgsync -o nospace hgsync
+
 _pathsearch() {
   local prev cur=${COMP_WORDS[COMP_CWORD]}
   [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}