Add a -a flag to set-option and set-window-option to append to an existing

string value, useful for terminal-overrides.
This commit is contained in:
Nicholas Marriott
2009-08-04 18:45:57 +00:00
parent a0647f1616
commit 12ef3ceda1
5 changed files with 35 additions and 16 deletions

View File

@ -31,8 +31,8 @@ int cmd_set_window_option_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_set_window_option_entry = {
"set-window-option", "setw",
CMD_OPTION_WINDOW_USAGE,
0, CMD_CHFLAG('g')|CMD_CHFLAG('u'),
"[-agu] " CMD_OPTION_WINDOW_USAGE,
0, CMD_CHFLAG('a')|CMD_CHFLAG('g')|CMD_CHFLAG('u'),
NULL,
cmd_option_parse,
cmd_set_window_option_exec,
@ -134,7 +134,8 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
} else {
switch (entry->type) {
case SET_OPTION_STRING:
set_option_string(ctx, oo, entry, data->value);
set_option_string(ctx, oo, entry,
data->value, data->chflags & CMD_CHFLAG('a'));
break;
case SET_OPTION_NUMBER:
set_option_number(ctx, oo, entry, data->value);