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

Diff for /src/usr.bin/tmux/cmd-unbind-key.c between version 1.16 and 1.17

version 1.16, 2013/03/24 09:54:10 version 1.17, 2013/10/10 12:00:24
Line 26 
Line 26 
  * Unbind key from command.   * Unbind key from command.
  */   */
   
 enum cmd_retval  cmd_unbind_key_check(struct args *);  
 enum cmd_retval  cmd_unbind_key_exec(struct cmd *, struct cmd_q *);  enum cmd_retval  cmd_unbind_key_exec(struct cmd *, struct cmd_q *);
 enum cmd_retval  cmd_unbind_key_table(struct cmd *, struct cmd_q *, int);  enum cmd_retval  cmd_unbind_key_table(struct cmd *, struct cmd_q *, int);
   
Line 36 
Line 35 
         "[-acn] [-t key-table] key",          "[-acn] [-t key-table] key",
         0,          0,
         NULL,          NULL,
         cmd_unbind_key_check,  
         cmd_unbind_key_exec          cmd_unbind_key_exec
 };  };
   
 enum cmd_retval  enum cmd_retval
 cmd_unbind_key_check(struct args *args)  
 {  
         if (args_has(args, 'a') && args->argc != 0)  
                 return (CMD_RETURN_ERROR);  
         if (!args_has(args, 'a') && args->argc != 1)  
                 return (CMD_RETURN_ERROR);  
         return (CMD_RETURN_NORMAL);  
 }  
   
 enum cmd_retval  
 cmd_unbind_key_exec(struct cmd *self, struct cmd_q *cmdq)  cmd_unbind_key_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args             *args = self->args;          struct args             *args = self->args;
Line 58 
Line 46 
         int                      key;          int                      key;
   
         if (!args_has(args, 'a')) {          if (!args_has(args, 'a')) {
                   if (args->argc != 1) {
                           cmdq_error(cmdq, "missing key");
                           return (CMD_RETURN_ERROR);
                   }
                   return (CMD_RETURN_ERROR);
                 key = key_string_lookup_string(args->argv[0]);                  key = key_string_lookup_string(args->argv[0]);
                 if (key == KEYC_NONE) {                  if (key == KEYC_NONE) {
                         cmdq_error(cmdq, "unknown key: %s", args->argv[0]);                          cmdq_error(cmdq, "unknown key: %s", args->argv[0]);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
         } else          } else {
                   if (args->argc != 0) {
                           cmdq_error(cmdq, "key given with -a");
                           return (CMD_RETURN_ERROR);
                   }
                 key = KEYC_NONE;                  key = KEYC_NONE;
           }
   
         if (args_has(args, 't'))          if (args_has(args, 't'))
                 return (cmd_unbind_key_table(self, cmdq, key));                  return (cmd_unbind_key_table(self, cmdq, key));

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17