[BACK]Return to cmd-set-option.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-set-option.c between version 1.124 and 1.125

version 1.124, 2019/04/23 20:36:55 version 1.125, 2019/04/26 11:38:51
Line 65 
Line 65 
         .exec = cmd_set_option_exec          .exec = cmd_set_option_exec
 };  };
   
   const struct cmd_entry cmd_set_hook_entry = {
           .name = "set-hook",
           .alias = NULL,
   
           .args = { "agRt:u", 1, 2 },
           .usage = "[-agRu] " CMD_TARGET_SESSION_USAGE " hook [command]",
   
           .target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL },
   
           .flags = CMD_AFTERHOOK,
           .exec = cmd_set_option_exec
   };
   
 static enum cmd_retval  static enum cmd_retval
 cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)  cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
 {  {
Line 87 
Line 100 
         c = cmd_find_client(item, NULL, 1);          c = cmd_find_client(item, NULL, 1);
         argument = format_single(item, args->argv[0], c, s, wl, NULL);          argument = format_single(item, args->argv[0], c, s, wl, NULL);
   
           if (self->entry == &cmd_set_hook_entry && args_has(args, 'R')) {
                   notify_hook(item, argument);
                   return (CMD_RETURN_NORMAL);
           }
   
         /* Parse option name and index. */          /* Parse option name and index. */
         name = options_match(argument, &idx, &ambiguous);          name = options_match(argument, &idx, &ambiguous);
         if (name == NULL) {          if (name == NULL) {
Line 200 
Line 218 
                                 options_default(oo, options_table_entry(o));                                  options_default(oo, options_table_entry(o));
                         else                          else
                                 options_remove(o);                                  options_remove(o);
                 } else                  } else if (options_array_set(o, idx, NULL, 0, &cause) != 0) {
                         options_array_set(o, idx, NULL, 0);                          cmdq_error(item, "%s", cause);
                           free(cause);
                           goto fail;
                   }
         } else if (*name == '@') {          } else if (*name == '@') {
                 if (value == NULL) {                  if (value == NULL) {
                         cmdq_error(item, "empty value");                          cmdq_error(item, "empty value");
Line 222 
Line 243 
                 if (idx == -1) {                  if (idx == -1) {
                         if (!append)                          if (!append)
                                 options_array_clear(o);                                  options_array_clear(o);
                         options_array_assign(o, value);                          if (options_array_assign(o, value, &cause) != 0) {
                 } else if (options_array_set(o, idx, value, append) != 0) {                                  cmdq_error(item, "%s", cause);
                         cmdq_error(item, "invalid index: %s", argument);                                  free(cause);
                                   goto fail;
                           }
                   } else if (options_array_set(o, idx, value, append,
                       &cause) != 0) {
                           cmdq_error(item, "%s", cause);
                           free(cause);
                         goto fail;                          goto fail;
                 }                  }
         }          }
Line 366 
Line 393 
                         return (-1);                          return (-1);
                 }                  }
                 return (0);                  return (0);
           case OPTIONS_TABLE_COMMAND:
                   break;
         }          }
         return (-1);          return (-1);
 }  }

Legend:
Removed from v.1.124  
changed lines
  Added in v.1.125