Skip to content

Commit

Permalink
Adds the option to override host mode
Browse files Browse the repository at this point in the history
This change allows a host user to pass "client" as the first
command-line argument in order to access the client mode commands.
  • Loading branch information
jballanc committed Oct 10, 2012
1 parent e49122e commit 4d5929b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions wemux
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,16 @@ build_wemux_prefix

# Don't allow wemux to be run directly within a wemux server.
if [[ "$TMUX" != *$socket* ]] || allowed_nested_command "$1" ; then
# If user is in host list, use host mode. If not, use client mode.
if user_is_a_host; then
host_mode "$@"
# Allow manual override to operate in client mode.
if [ "$1" = "client" ]; then
shift; client_mode "$@"
else
client_mode "$@"
# If user is in host list, use host mode. If not, use client mode.
if user_is_a_host; then
host_mode "$@"
else
client_mode "$@"
fi
fi
else
echo "You're already attached to the wemux server on '$server'"
Expand Down

0 comments on commit 4d5929b

Please sign in to comment.