From: Richard Hartmann Date: Sun, 29 Nov 2015 12:53:56 +0000 (+0100) Subject: Merge branch 'feature/fix-d946b07817ffe6e156c159e7fc6270322413e530' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/0554f58886a62ee654998cc656d923fe86246cd7?ds=inline;hp=--cc Merge branch 'feature/fix-d946b07817ffe6e156c159e7fc6270322413e530' --- 0554f58886a62ee654998cc656d923fe86246cd7 diff --cc vcsh index 11370f8,ff256da..e339cde --- a/vcsh +++ b/vcsh @@@ -425,10 -425,16 +425,14 @@@ use() } which() { - [ -e "$VCSH_COMMAND_PARAMETER" ] || fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 - for VCSH_REPO_NAME in $(list); do + output=$(for VCSH_REPO_NAME in $(list); do - for VCSH_FILE in $(get_files); do - echo "$VCSH_FILE" | grep -q "$VCSH_COMMAND_PARAMETER" && echo "$VCSH_REPO_NAME: $VCSH_FILE" - done + get_files | grep -- "$VCSH_COMMAND_PARAMETER" | sed "s/^/$VCSH_REPO_NAME: /" - done | sort -u + done | sort -u) + if [ -z "$output" ]; then + fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 + else + echo "$output" + fi } write_gitignore() {