mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Move list-commands into list-keys.
This commit is contained in:
		
							
								
								
									
										1
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Makefile
									
									
									
									
									
								
							@@ -32,7 +32,6 @@ SRCS=	arguments.c \
 | 
				
			|||||||
	cmd-link-window.c \
 | 
						cmd-link-window.c \
 | 
				
			||||||
	cmd-list-buffers.c \
 | 
						cmd-list-buffers.c \
 | 
				
			||||||
	cmd-list-clients.c \
 | 
						cmd-list-clients.c \
 | 
				
			||||||
	cmd-list-commands.c \
 | 
					 | 
				
			||||||
	cmd-list-keys.c \
 | 
						cmd-list-keys.c \
 | 
				
			||||||
	cmd-list-panes.c \
 | 
						cmd-list-panes.c \
 | 
				
			||||||
	cmd-list-sessions.c \
 | 
						cmd-list-sessions.c \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,14 +26,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
enum cmd_retval	 cmd_list_commands_exec(struct cmd *, struct cmd_q *);
 | 
					enum cmd_retval	 cmd_list_commands_exec(struct cmd *, struct cmd_q *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct cmd_entry cmd_list_commands_entry = {
 | 
					 | 
				
			||||||
	"list-commands", "lscm",
 | 
					 | 
				
			||||||
	"", 0, 0,
 | 
					 | 
				
			||||||
	"",
 | 
					 | 
				
			||||||
	0,
 | 
					 | 
				
			||||||
	cmd_list_commands_exec
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
enum cmd_retval
 | 
					enum cmd_retval
 | 
				
			||||||
cmd_list_commands_exec(unused struct cmd *self, struct cmd_q *cmdq)
 | 
					cmd_list_commands_exec(unused struct cmd *self, struct cmd_q *cmdq)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,9 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum cmd_retval	 cmd_list_keys_exec(struct cmd *, struct cmd_q *);
 | 
					enum cmd_retval	 cmd_list_keys_exec(struct cmd *, struct cmd_q *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum cmd_retval	 cmd_list_keys_table(struct cmd *, struct cmd_q *);
 | 
					enum cmd_retval	 cmd_list_keys_table(struct cmd *, struct cmd_q *);
 | 
				
			||||||
 | 
					enum cmd_retval	 cmd_list_keys_commands(struct cmd *, struct cmd_q *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct cmd_entry cmd_list_keys_entry = {
 | 
					const struct cmd_entry cmd_list_keys_entry = {
 | 
				
			||||||
	"list-keys", "lsk",
 | 
						"list-keys", "lsk",
 | 
				
			||||||
@@ -37,6 +39,14 @@ const struct cmd_entry cmd_list_keys_entry = {
 | 
				
			|||||||
	cmd_list_keys_exec
 | 
						cmd_list_keys_exec
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const struct cmd_entry cmd_list_commands_entry = {
 | 
				
			||||||
 | 
						"list-commands", "lscm",
 | 
				
			||||||
 | 
						"", 0, 0,
 | 
				
			||||||
 | 
						"",
 | 
				
			||||||
 | 
						0,
 | 
				
			||||||
 | 
						cmd_list_keys_exec
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum cmd_retval
 | 
					enum cmd_retval
 | 
				
			||||||
cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
					cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -47,6 +57,9 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
	size_t			 used;
 | 
						size_t			 used;
 | 
				
			||||||
	int			 width, keywidth;
 | 
						int			 width, keywidth;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (self->entry == &cmd_list_commands_entry)
 | 
				
			||||||
 | 
							return (cmd_list_keys_commands(self, cmdq));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (args_has(args, 't'))
 | 
						if (args_has(args, 't'))
 | 
				
			||||||
		return (cmd_list_keys_table(self, cmdq));
 | 
							return (cmd_list_keys_table(self, cmdq));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -147,3 +160,22 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	return (CMD_RETURN_NORMAL);
 | 
						return (CMD_RETURN_NORMAL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum cmd_retval
 | 
				
			||||||
 | 
					cmd_list_keys_commands(unused struct cmd *self, struct cmd_q *cmdq)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						const struct cmd_entry	**entryp;
 | 
				
			||||||
 | 
						struct cmd_entry	 *entry;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (entryp = cmd_table; *entryp != NULL; entryp++) {
 | 
				
			||||||
 | 
							entry = *entryp;
 | 
				
			||||||
 | 
							if (entry->alias == NULL) {
 | 
				
			||||||
 | 
								cmdq_print(cmdq, "%s %s", entry->name, entry->usage);
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							cmdq_print(cmdq, "%s (%s) %s", entry->name, entry->alias,
 | 
				
			||||||
 | 
							    entry->usage);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return (CMD_RETURN_NORMAL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user