Added completion for hgsync.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 24 Dec 2022 13:30:30 +0200
changeset 1007 0077617b0deb
parent 1006 ad4478dd89fc
child 1008 86630b8cd151
Added completion for hgsync.
.bash_completion
--- 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]}