contrib/bash_completion
changeset 9460 552c5a5a3502
parent 8719 b5e9ed63913b
child 9602 fc493cb90bb1
--- a/contrib/bash_completion	Thu Sep 17 22:28:47 2009 -0400
+++ b/contrib/bash_completion	Thu Sep 17 22:30:45 2009 -0400
@@ -278,6 +278,22 @@
 
 # Completion for commands provided by extensions
 
+# bookmarks
+_hg_bookmarks()
+{
+    local bookmarks="$("$hg" bookmarks --quiet 2>/dev/null )"
+    local IFS=$'\n'
+    COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$bookmarks' -- "$cur"))
+}
+
+_hg_cmd_bookmarks()
+{
+    if [[ "$prev" = @(-d|--delete|-m|--rename) ]]; then
+        _hg_bookmarks
+        return
+    fi
+}
+
 # mq
 _hg_ext_mq_patchlist()
 {