Patchwork [2,of,2] bash_completion: complete arguments for --color and --pager

login
register
mail settings
Submitter Anton Shestakov
Date Sept. 2, 2018, 12:54 a.m.
Message ID <2a342d7f75f02808bebb.1535849688@neuro>
Download mbox | patch
Permalink /patch/34242/
State Accepted
Headers show

Comments

Anton Shestakov - Sept. 2, 2018, 12:54 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1535848857 -28800
#      Sun Sep 02 08:40:57 2018 +0800
# Node ID 2a342d7f75f02808bebbb811ed3998b65e7b2aad
# Parent  14eaf06a028a010ca829084acfb866823ad5714a
bash_completion: complete arguments for --color and --pager

Patch

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -206,6 +206,18 @@  shopt -s extglob
             _hg_fix_wordlist
             return
         ;;
+        --color)
+            local choices='true false yes no always auto never debug'
+            COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$choices' -- "$cur"))
+            _hg_fix_wordlist
+            return
+        ;;
+        --pager)
+            local choices='true false yes no always auto never'
+            COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$choices' -- "$cur"))
+            _hg_fix_wordlist
+            return
+        ;;
     esac
 
     if [ -z "$cmd" ] || [ $COMP_CWORD -eq $i ]; then