Mercurial > hg
changeset 20132:d14f9c4a4398
bash_completion: simplify if-else logic
There is no change in functionality here but this makes refactoring this later
easier.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Tue, 26 Nov 2013 13:55:33 -0600 |
parents | 56df59cc4212 |
children | f6c33fc59dbd |
files | contrib/bash_completion |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/bash_completion Mon Nov 25 11:38:14 2013 -0500 +++ b/contrib/bash_completion Tue Nov 26 13:55:33 2013 -0600 @@ -240,15 +240,11 @@ fi if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then - if [ $canonical = 1 ]; then + if [[ $canonical = 1 || status != "$cmd"* ]]; then _hg_labels return 0 - elif [[ status != "$cmd"* ]]; then - _hg_labels - return 0 - else - return 1 fi + return 1 fi local aliascmd=$(_hg_cmd showconfig alias.$cmd | awk '{print $1}')