[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.89 and 1.90

version 1.89, 2015/12/12 18:32:24 version 1.90, 2015/12/13 14:32:38
Line 67 
Line 67 
 const struct cmd_entry cmd_set_option_entry = {  const struct cmd_entry cmd_set_option_entry = {
         "set-option", "set",          "set-option", "set",
         "agoqst:uw", 1, 2,          "agoqst:uw", 1, 2,
         "[-agosquw] [-t target-session|target-window] option [value]",          "[-agosquw] [-t target-window] option [value]",
         0,          CMD_WINDOW_T|CMD_CANFAIL,
         cmd_set_option_exec          cmd_set_option_exec
 };  };
   
Line 76 
Line 76 
         "set-window-option", "setw",          "set-window-option", "setw",
         "agoqt:u", 1, 2,          "agoqt:u", 1, 2,
         "[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",          "[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
         0,          CMD_WINDOW_T|CMD_CANFAIL,
         cmd_set_option_exec          cmd_set_option_exec
 };  };
   
Line 84 
Line 84 
 cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)  cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args                             *args = self->args;          struct args                             *args = self->args;
         const struct options_table_entry        *oe;          struct session                          *s = cmdq->state.tflag.s;
         struct session                          *s;          struct winlink                          *wl = cmdq->state.tflag.wl;
         struct winlink                          *wl;          struct window                           *w;
         struct client                           *c;          struct client                           *c;
           const struct options_table_entry        *oe;
         struct options                          *oo;          struct options                          *oo;
         struct window                           *w;  
         const char                              *optstr, *valstr;          const char                              *optstr, *valstr;
   
         /* Get the option name and value. */          /* Get the option name and value. */
Line 131 
Line 131 
                 if (args_has(self->args, 'g'))                  if (args_has(self->args, 'g'))
                         oo = global_w_options;                          oo = global_w_options;
                 else {                  else {
                         wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);  
                         if (wl == NULL) {                          if (wl == NULL) {
                                 cmdq_error(cmdq,                                  cmdq_error(cmdq,
                                     "couldn't set '%s'%s", optstr,                                      "couldn't set '%s'%s", optstr,
Line 145 
Line 144 
                 if (args_has(self->args, 'g'))                  if (args_has(self->args, 'g'))
                         oo = global_s_options;                          oo = global_s_options;
                 else {                  else {
                         s = cmd_find_session(cmdq, args_get(args, 't'), 0);  
                         if (s == NULL) {                          if (s == NULL) {
                                 cmdq_error(cmdq,                                  cmdq_error(cmdq,
                                     "couldn't set '%s'%s", optstr,                                      "couldn't set '%s'%s", optstr,
Line 209 
Line 207 
     const char *valstr)      const char *valstr)
 {  {
         struct args     *args = self->args;          struct args     *args = self->args;
         struct session  *s;          struct session  *s = cmdq->state.tflag.s;
         struct winlink  *wl;          struct winlink  *wl = cmdq->state.tflag.wl;
         struct options  *oo;          struct options  *oo;
   
         if (args_has(args, 's'))          if (args_has(args, 's'))
Line 219 
Line 217 
             self->entry == &cmd_set_window_option_entry) {              self->entry == &cmd_set_window_option_entry) {
                 if (args_has(self->args, 'g'))                  if (args_has(self->args, 'g'))
                         oo = global_w_options;                          oo = global_w_options;
                 else {                  else
                         wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);  
                         if (wl == NULL)  
                                 return (CMD_RETURN_ERROR);  
                         oo = wl->window->options;                          oo = wl->window->options;
                 }  
         } else {          } else {
                 if (args_has(self->args, 'g'))                  if (args_has(self->args, 'g'))
                         oo = global_s_options;                          oo = global_s_options;
                 else {                  else
                         s = cmd_find_session(cmdq, args_get(args, 't'), 0);  
                         if (s == NULL)  
                                 return (CMD_RETURN_ERROR);  
                         oo = s->options;                          oo = s->options;
                 }  
         }          }
   
         if (args_has(args, 'u')) {          if (args_has(args, 'u')) {

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90