version 1.579, 2017/09/11 06:53:06 |
version 1.580, 2017/10/06 18:02:30 |
|
|
and |
and |
.Em %endif |
.Em %endif |
lines. |
lines. |
|
Additional |
|
.Em %elif |
|
and |
|
.Em %else |
|
lines may also be used. |
The argument to |
The argument to |
.Em %if |
.Em %if |
is expanded as a format and if it evaluates to false |
and |
(zero or empty), subsequent lines are ignored until |
.Em %elif |
|
is expanded as a format and if it evaluates to false (zero or empty), |
|
subsequent lines are ignored until the next |
|
.Em %elif , |
|
.Em %else |
|
or |
.Em %endif . |
.Em %endif . |
For example: |
For example: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
%if #{==:#{host},myhost} |
%if #{==:#{host},myhost} |
set -g status-style bg=red |
set -g status-style bg=red |
|
%elif #{==:#{host},myotherhost} |
|
set -g status-style bg=green |
|
%else |
|
set -g status-style bg=blue |
%endif |
%endif |
.Ed |
.Ed |
.Pp |
.Pp |
Will change the status line to red if running on |
Will change the status line to red if running on |
.Ql myhost . |
.Ql myhost , |
.Em %if |
green if running on |
may not be nested. |
.Ql myotherhost , |
|
or blue if running on another host. |
.It Ic start-server |
.It Ic start-server |
.D1 (alias: Ic start ) |
.D1 (alias: Ic start ) |
Start the |
Start the |