Skip to content

Commit

Permalink
Merge pull request zolrath#47 from nilbus/exit-status
Browse files Browse the repository at this point in the history
Return an error exit status from client commands that fail
  • Loading branch information
zolrath committed Aug 22, 2015
2 parents 115f512 + fee7f48 commit 01c6541
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wemux
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ announce_connection() {
[ "$announce_attach" == "true" ] && redirect=`$wemux display-message \
"$username has attached in $connection_type mode." 2>&1`
$attach_commands
status=$?
[ "$announce_attach" == "true" ] && redirect=`$wemux display-message \
"$username has detached." 2>&1`
return 0
return $status
}

# Announces when a user joins/changes their server.
Expand Down Expand Up @@ -521,6 +522,7 @@ client_mode() {
$wemux attach -t $server -r
else
echo "No wemux server to mirror on '$server'."
return 126
fi
}

Expand All @@ -531,6 +533,7 @@ client_mode() {
$wemux attach -t $server
else
echo "No wemux server to pair with on '$server'."
return 126
fi
else
echo "Pair mode is disabled."
Expand All @@ -552,6 +555,7 @@ client_mode() {
$wemux attach -t $client_session
else
echo "No wemux server to go 'rogue' with on '$server'."
return 126
fi
else
echo "Rogue mode is disabled."
Expand All @@ -569,6 +573,7 @@ client_mode() {
echo "Logged out of rogue mode on '$server'."
else
echo "No wemux server to log out of on '$server'."
return 126
fi
else
echo "Rogue mode is disabled."
Expand Down Expand Up @@ -599,6 +604,7 @@ client_mode() {
announce_connection "mirror" $wemux attach -t $server -r
else
echo "No wemux server to attach to on '$server'"
return 126
fi
}

Expand Down

0 comments on commit 01c6541

Please sign in to comment.