Skip to content

Commit

Permalink
Revert "Fix issue #79 - expand aliases to detect potentially better o…
Browse files Browse the repository at this point in the history
…nes"

This reverts commit a0ee820.
  • Loading branch information
MichaelAquilina committed Oct 13, 2019
1 parent 45f190a commit 60254f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/test_aliases.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@
assert $state equals 0
}

@test 'expands aliases to find potentially better matches' {
@test 'issue 79 - expands aliases' {
alias gd='git diff'
alias gdw='git diff --word-diff'
run _check_aliases "gd --word-diff" "git diff --word-diff"
run _check_aliases "gd --word-diff"

assert $output contains 'You should use: "gdw"'
assert $state equals 0
}
}
5 changes: 1 addition & 4 deletions you-should-use.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ function _check_aliases() {
continue
fi

if [[ "$typed" = "$value" || \
"$typed" = "$value "* ||
"$expanded" = "$value" || \
"$expanded" = "$value "* ]]; then
if [[ "$typed" = "$value" || "$typed" = "$value "* ]]; then

# if the alias longer or the same length as its command
# we assume that it is there to cater for typos.
Expand Down

0 comments on commit 60254f7

Please sign in to comment.