# HG changeset patch # User Sean Farley # Date 2013-11-26 20:04:12 # Node ID f6c33fc59dbd72344040ac1da254ef6e262f0273 # Parent d14f9c4a4398d343fbdf89f69f5011c80fea43bd bash_completion: change --rev if-else block into a case Again, this doesn't change behavior but does make it easy to add cases in the next patch. diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -239,12 +239,16 @@ shopt -s extglob return 0 fi - if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then - if [[ $canonical = 1 || status != "$cmd"* ]]; then - _hg_labels - return 0 - fi - return 1 + if [ "$cmd" != status ]; then + case "$prev" in + -r|--rev) + if [[ $canonical = 1 || status != "$cmd"* ]]; then + _hg_labels + return 0 + fi + return 1 + ;; + esac fi local aliascmd=$(_hg_cmd showconfig alias.$cmd | awk '{print $1}')