Use member names in cmd_entry definitions so I stop getting confused

about the order.
This commit is contained in:
nicm 2015-12-13 21:53:57 +00:00
parent 899bee0056
commit ecfeee2e82
63 changed files with 716 additions and 449 deletions

View File

@ -33,11 +33,14 @@
enum cmd_retval cmd_attach_session_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_attach_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_attach_session_entry = { const struct cmd_entry cmd_attach_session_entry = {
"attach-session", "attach", .name = "attach-session",
"c:dErt:", 0, 0, .alias = "attach",
"[-dEr] [-c working-directory] " CMD_TARGET_SESSION_USAGE,
CMD_STARTSERVER|CMD_SESSION_T|CMD_PANE_T|CMD_PREFERUNATTACHED, .args = { "c:dErt:", 0, 0 },
cmd_attach_session_exec .usage = "[-dEr] [-c working-directory] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_STARTSERVER|CMD_SESSION_T|CMD_PANE_T|CMD_PREFERUNATTACHED,
.exec = cmd_attach_session_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -33,11 +33,15 @@ enum cmd_retval cmd_bind_key_mode_table(struct cmd *, struct cmd_q *,
key_code); key_code);
const struct cmd_entry cmd_bind_key_entry = { const struct cmd_entry cmd_bind_key_entry = {
"bind-key", "bind", .name = "bind-key",
"cnrt:T:", 1, -1, .alias = "bind",
"[-cnr] [-t mode-table] [-T key-table] key command [arguments]",
0, .args = { "cnrt:T:", 1, -1 },
cmd_bind_key_exec .usage = "[-cnr] [-t mode-table] [-T key-table] key command "
"[arguments]",
.flags = 0,
.exec = cmd_bind_key_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -31,11 +31,14 @@
enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_break_pane_entry = { const struct cmd_entry cmd_break_pane_entry = {
"break-pane", "breakp", .name = "break-pane",
"dPF:s:t:", 0, 0, .alias = "breakp",
"[-dP] [-F format] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_S|CMD_INDEX_T, .args = { "dPF:s:t:", 0, 0 },
cmd_break_pane_exec .usage = "[-dP] [-F format] " CMD_SRCDST_PANE_USAGE,
.flags = CMD_PANE_S|CMD_INDEX_T,
.exec = cmd_break_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -36,12 +36,15 @@ char *cmd_capture_pane_history(struct args *, struct cmd_q *,
struct window_pane *, size_t *); struct window_pane *, size_t *);
const struct cmd_entry cmd_capture_pane_entry = { const struct cmd_entry cmd_capture_pane_entry = {
"capture-pane", "capturep", .name = "capture-pane",
"ab:CeE:JpPqS:t:", 0, 0, .alias = "capturep",
"[-aCeJpPq] " CMD_BUFFER_USAGE " [-E end-line] [-S start-line]"
CMD_TARGET_PANE_USAGE, .args = { "ab:CeE:JpPqS:t:", 0, 0 },
CMD_PANE_T, .usage = "[-aCeJpPq] " CMD_BUFFER_USAGE " [-E end-line] "
cmd_capture_pane_exec "[-S start-line]" CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_capture_pane_exec
}; };
char * char *

View File

@ -33,11 +33,14 @@
enum cmd_retval cmd_choose_buffer_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_choose_buffer_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_choose_buffer_entry = { const struct cmd_entry cmd_choose_buffer_entry = {
"choose-buffer", NULL, .name = "choose-buffer",
"F:t:", 0, 1, .alias = NULL,
CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
CMD_WINDOW_T, .args = { "F:t:", 0, 1 },
cmd_choose_buffer_exec .usage = CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
.flags = CMD_WINDOW_T,
.exec = cmd_choose_buffer_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -38,11 +38,14 @@ enum cmd_retval cmd_choose_client_exec(struct cmd *, struct cmd_q *);
void cmd_choose_client_callback(struct window_choose_data *); void cmd_choose_client_callback(struct window_choose_data *);
const struct cmd_entry cmd_choose_client_entry = { const struct cmd_entry cmd_choose_client_entry = {
"choose-client", NULL, .name = "choose-client",
"F:t:", 0, 1, .alias = NULL,
CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
CMD_WINDOW_T, .args = { "F:t:", 0, 1 },
cmd_choose_client_exec .usage = CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
.flags = CMD_WINDOW_T,
.exec = cmd_choose_client_exec
}; };
struct cmd_choose_client_data { struct cmd_choose_client_data {

View File

@ -44,28 +44,38 @@
enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_choose_tree_entry = { const struct cmd_entry cmd_choose_tree_entry = {
"choose-tree", NULL, .name = "choose-tree",
"S:W:swub:c:t:", 0, 1, .alias = NULL,
"[-suw] [-b session-template] [-c window template] [-S format] " \
"[-W format] " CMD_TARGET_WINDOW_USAGE, .args = { "S:W:swub:c:t:", 0, 1 },
CMD_WINDOW_T, .usage = "[-suw] [-b session-template] [-c window template] "
cmd_choose_tree_exec "[-S format] [-W format] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_choose_tree_exec
}; };
const struct cmd_entry cmd_choose_session_entry = { const struct cmd_entry cmd_choose_session_entry = {
"choose-session", NULL, .name = "choose-session",
"F:t:", 0, 1, .alias = NULL,
CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
CMD_WINDOW_T, .args = { "F:t:", 0, 1 },
cmd_choose_tree_exec
.usage = CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
.flags = CMD_WINDOW_T,
.exec = cmd_choose_tree_exec
}; };
const struct cmd_entry cmd_choose_window_entry = { const struct cmd_entry cmd_choose_window_entry = {
"choose-window", NULL, .name = "choose-window",
"F:t:", 0, 1, .alias = NULL,
CMD_TARGET_WINDOW_USAGE "[-F format] [template]",
CMD_WINDOW_T, .args = { "F:t:", 0, 1 },
cmd_choose_tree_exec .usage = CMD_TARGET_WINDOW_USAGE "[-F format] [template]",
.flags = CMD_WINDOW_T,
.exec = cmd_choose_tree_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,11 +27,14 @@
enum cmd_retval cmd_clear_history_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_clear_history_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_clear_history_entry = { const struct cmd_entry cmd_clear_history_entry = {
"clear-history", "clearhist", .name = "clear-history",
"t:", 0, 0, .alias = "clearhist",
CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "t:", 0, 0 },
cmd_clear_history_exec .usage = CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_clear_history_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -35,11 +35,15 @@ int cmd_command_prompt_callback(void *, const char *);
void cmd_command_prompt_free(void *); void cmd_command_prompt_free(void *);
const struct cmd_entry cmd_command_prompt_entry = { const struct cmd_entry cmd_command_prompt_entry = {
"command-prompt", NULL, .name = "command-prompt",
"I:p:t:", 0, 1, .alias = NULL,
"[-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " [template]",
CMD_CLIENT_T, .args = { "I:p:t:", 0, 1 },
cmd_command_prompt_exec .usage = "[-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
"[template]",
.flags = CMD_CLIENT_T,
.exec = cmd_command_prompt_exec
}; };
struct cmd_command_prompt_cdata { struct cmd_command_prompt_cdata {

View File

@ -34,11 +34,14 @@ int cmd_confirm_before_callback(void *, const char *);
void cmd_confirm_before_free(void *); void cmd_confirm_before_free(void *);
const struct cmd_entry cmd_confirm_before_entry = { const struct cmd_entry cmd_confirm_before_entry = {
"confirm-before", "confirm", .name = "confirm-before",
"p:t:", 1, 1, .alias = "confirm",
"[-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
CMD_CLIENT_T, .args = { "p:t:", 1, 1 },
cmd_confirm_before_exec .usage = "[-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
.flags = CMD_CLIENT_T,
.exec = cmd_confirm_before_exec
}; };
struct cmd_confirm_before_data { struct cmd_confirm_before_data {

View File

@ -27,19 +27,25 @@
enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_copy_mode_entry = { const struct cmd_entry cmd_copy_mode_entry = {
"copy-mode", NULL, .name = "copy-mode",
"Met:u", 0, 0, .alias = NULL,
"[-Mu] " CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "Met:u", 0, 0 },
cmd_copy_mode_exec .usage = "[-Mu] " CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_copy_mode_exec
}; };
const struct cmd_entry cmd_clock_mode_entry = { const struct cmd_entry cmd_clock_mode_entry = {
"clock-mode", NULL, .name = "clock-mode",
"t:", 0, 0, .alias = NULL,
CMD_TARGET_PANE_USAGE,
0, .args = { "t:", 0, 0 },
cmd_copy_mode_exec .usage = CMD_TARGET_PANE_USAGE,
.flags = 0,
.exec = cmd_copy_mode_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,19 +29,25 @@
enum cmd_retval cmd_detach_client_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_detach_client_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_detach_client_entry = { const struct cmd_entry cmd_detach_client_entry = {
"detach-client", "detach", .name = "detach-client",
"as:t:P", 0, 0, .alias = "detach",
"[-P] [-a] [-s target-session] " CMD_TARGET_CLIENT_USAGE,
CMD_READONLY|CMD_CLIENT_T|CMD_SESSION_S, .args = { "as:t:P", 0, 0 },
cmd_detach_client_exec .usage = "[-P] [-a] [-s target-session] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_READONLY|CMD_CLIENT_T|CMD_SESSION_S,
.exec = cmd_detach_client_exec
}; };
const struct cmd_entry cmd_suspend_client_entry = { const struct cmd_entry cmd_suspend_client_entry = {
"suspend-client", "suspendc", .name = "suspend-client",
"t:", 0, 0, .alias = "suspendc",
CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T, .args = { "t:", 0, 0 },
cmd_detach_client_exec .usage = CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_detach_client_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -35,12 +35,15 @@
enum cmd_retval cmd_display_message_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_display_message_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_display_message_entry = { const struct cmd_entry cmd_display_message_entry = {
"display-message", "display", .name = "display-message",
"c:pt:F:", 0, 1, .alias = "display",
"[-p] [-c target-client] [-F format] " CMD_TARGET_PANE_USAGE
" [message]", .args = { "c:pt:F:", 0, 1 },
CMD_CLIENT_C|CMD_PANE_T|CMD_CLIENT_CANFAIL, .usage = "[-p] [-c target-client] [-F format] "
cmd_display_message_exec CMD_TARGET_PANE_USAGE " [message]",
.flags = CMD_CLIENT_C|CMD_PANE_T|CMD_CLIENT_CANFAIL,
.exec = cmd_display_message_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,11 +27,14 @@
enum cmd_retval cmd_display_panes_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_display_panes_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_display_panes_entry = { const struct cmd_entry cmd_display_panes_entry = {
"display-panes", "displayp", .name = "display-panes",
"t:", 0, 0, .alias = "displayp",
CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T, .args = { "t:", 0, 0 },
cmd_display_panes_exec .usage = CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_display_panes_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -48,11 +48,14 @@ void cmd_find_window_callback(struct window_choose_data *);
CMD_FIND_WINDOW_BY_NAME) CMD_FIND_WINDOW_BY_NAME)
const struct cmd_entry cmd_find_window_entry = { const struct cmd_entry cmd_find_window_entry = {
"find-window", "findw", .name = "find-window",
"F:CNt:T", 1, 4, .alias = "findw",
"[-CNT] [-F format] " CMD_TARGET_WINDOW_USAGE " match-string",
CMD_WINDOW_T, .args = { "F:CNt:T", 1, 4 },
cmd_find_window_exec .usage = "[-CNT] [-F format] " CMD_TARGET_WINDOW_USAGE " match-string",
.flags = CMD_WINDOW_T,
.exec = cmd_find_window_exec
}; };
struct cmd_find_window_data { struct cmd_find_window_data {

View File

@ -36,11 +36,15 @@ void cmd_if_shell_done(struct cmd_q *);
void cmd_if_shell_free(void *); void cmd_if_shell_free(void *);
const struct cmd_entry cmd_if_shell_entry = { const struct cmd_entry cmd_if_shell_entry = {
"if-shell", "if", .name = "if-shell",
"bFt:", 2, 3, .alias = "if",
"[-bF] " CMD_TARGET_PANE_USAGE " shell-command command [command]",
CMD_PANE_T|CMD_CANFAIL, .args = { "bFt:", 2, 3 },
cmd_if_shell_exec .usage = "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command "
"[command]",
.flags = CMD_PANE_T|CMD_CANFAIL,
.exec = cmd_if_shell_exec
}; };
struct cmd_if_shell_data { struct cmd_if_shell_data {

View File

@ -34,19 +34,25 @@ enum cmd_retval cmd_join_pane_exec(struct cmd *, struct cmd_q *);
enum cmd_retval join_pane(struct cmd *, struct cmd_q *, int); enum cmd_retval join_pane(struct cmd *, struct cmd_q *, int);
const struct cmd_entry cmd_join_pane_entry = { const struct cmd_entry cmd_join_pane_entry = {
"join-pane", "joinp", .name = "join-pane",
"bdhvp:l:s:t:", 0, 0, .alias = "joinp",
"[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_MARKED_S|CMD_PANE_T, .args = { "bdhvp:l:s:t:", 0, 0 },
cmd_join_pane_exec .usage = "[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
.flags = CMD_PANE_MARKED_S|CMD_PANE_T,
.exec = cmd_join_pane_exec
}; };
const struct cmd_entry cmd_move_pane_entry = { const struct cmd_entry cmd_move_pane_entry = {
"move-pane", "movep", .name = "move-pane",
"bdhvp:l:s:t:", 0, 0, .alias = "movep",
"[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_S|CMD_PANE_T, .args = { "bdhvp:l:s:t:", 0, 0 },
cmd_join_pane_exec .usage = "[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
.flags = CMD_PANE_S|CMD_PANE_T,
.exec = cmd_join_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_kill_pane_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_kill_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_kill_pane_entry = { const struct cmd_entry cmd_kill_pane_entry = {
"kill-pane", "killp", .name = "kill-pane",
"at:", 0, 0, .alias = "killp",
"[-a] " CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "at:", 0, 0 },
cmd_kill_pane_exec .usage = "[-a] " CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_kill_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,19 +30,25 @@
enum cmd_retval cmd_kill_server_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_kill_server_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_kill_server_entry = { const struct cmd_entry cmd_kill_server_entry = {
"kill-server", NULL, .name = "kill-server",
"", 0, 0, .alias = NULL,
"",
0, .args = { "", 0, 0 },
cmd_kill_server_exec .usage = "",
.flags = 0,
.exec = cmd_kill_server_exec
}; };
const struct cmd_entry cmd_start_server_entry = { const struct cmd_entry cmd_start_server_entry = {
"start-server", "start", .name = "start-server",
"", 0, 0, .alias = "start",
"",
CMD_STARTSERVER, .args = { "", 0, 0 },
cmd_kill_server_exec .usage = "",
.flags = CMD_STARTSERVER,
.exec = cmd_kill_server_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,11 +30,14 @@
enum cmd_retval cmd_kill_session_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_kill_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_kill_session_entry = { const struct cmd_entry cmd_kill_session_entry = {
"kill-session", NULL, .name = "kill-session",
"aCt:", 0, 0, .alias = NULL,
"[-aC] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "aCt:", 0, 0 },
cmd_kill_session_exec .usage = "[-aC] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_kill_session_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,19 +27,25 @@
enum cmd_retval cmd_kill_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_kill_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_kill_window_entry = { const struct cmd_entry cmd_kill_window_entry = {
"kill-window", "killw", .name = "kill-window",
"at:", 0, 0, .alias = "killw",
"[-a] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "at:", 0, 0 },
cmd_kill_window_exec .usage = "[-a] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_kill_window_exec
}; };
const struct cmd_entry cmd_unlink_window_entry = { const struct cmd_entry cmd_unlink_window_entry = {
"unlink-window", "unlinkw", .name = "unlink-window",
"kt:", 0, 0, .alias = "unlinkw",
"[-k] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "kt:", 0, 0 },
cmd_kill_window_exec .usage = "[-k] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_kill_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -33,11 +33,14 @@
enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_buffers_entry = { const struct cmd_entry cmd_list_buffers_entry = {
"list-buffers", "lsb", .name = "list-buffers",
"F:", 0, 0, .alias = "lsb",
"[-F format]",
0, .args = { "F:", 0, 0 },
cmd_list_buffers_exec .usage = "[-F format]",
.flags = 0,
.exec = cmd_list_buffers_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -36,11 +36,14 @@
enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_clients_entry = { const struct cmd_entry cmd_list_clients_entry = {
"list-clients", "lsc", .name = "list-clients",
"F:t:", 0, 0, .alias = "lsc",
"[-F format] " CMD_TARGET_SESSION_USAGE,
CMD_READONLY|CMD_SESSION_T, .args = { "F:t:", 0, 0 },
cmd_list_clients_exec .usage = "[-F format] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_READONLY|CMD_SESSION_T,
.exec = cmd_list_clients_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -33,19 +33,25 @@ enum cmd_retval cmd_list_keys_table(struct cmd *, struct cmd_q *);
enum cmd_retval cmd_list_keys_commands(struct cmd_q *); enum cmd_retval cmd_list_keys_commands(struct cmd_q *);
const struct cmd_entry cmd_list_keys_entry = { const struct cmd_entry cmd_list_keys_entry = {
"list-keys", "lsk", .name = "list-keys",
"t:T:", 0, 0, .alias = "lsk",
"[-t mode-table] [-T key-table]",
0, .args = { "t:T:", 0, 0 },
cmd_list_keys_exec .usage = "[-t mode-table] [-T key-table]",
.flags = 0,
.exec = cmd_list_keys_exec
}; };
const struct cmd_entry cmd_list_commands_entry = { const struct cmd_entry cmd_list_commands_entry = {
"list-commands", "lscm", .name = "list-commands",
"", 0, 0, .alias = "lscm",
"",
0, .args = { "", 0, 0 },
cmd_list_keys_exec .usage = "",
.flags = 0,
.exec = cmd_list_keys_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -35,11 +35,14 @@ void cmd_list_panes_window(struct cmd *, struct session *, struct winlink *,
struct cmd_q *, int); struct cmd_q *, int);
const struct cmd_entry cmd_list_panes_entry = { const struct cmd_entry cmd_list_panes_entry = {
"list-panes", "lsp", .name = "list-panes",
"asF:t:", 0, 0, .alias = "lsp",
"[-as] [-F format] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "asF:t:", 0, 0 },
cmd_list_panes_exec .usage = "[-as] [-F format] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_list_panes_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -39,11 +39,14 @@
enum cmd_retval cmd_list_sessions_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_list_sessions_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_sessions_entry = { const struct cmd_entry cmd_list_sessions_entry = {
"list-sessions", "ls", .name = "list-sessions",
"F:", 0, 0, .alias = "ls",
"[-F format]",
0, .args = { "F:", 0, 0 },
cmd_list_sessions_exec .usage = "[-F format]",
.flags = 0,
.exec = cmd_list_sessions_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -46,11 +46,14 @@ void cmd_list_windows_session(struct cmd *, struct session *,
struct cmd_q *, int); struct cmd_q *, int);
const struct cmd_entry cmd_list_windows_entry = { const struct cmd_entry cmd_list_windows_entry = {
"list-windows", "lsw", .name = "list-windows",
"F:at:", 0, 0, .alias = "lsw",
"[-a] [-F format] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "F:at:", 0, 0 },
cmd_list_windows_exec .usage = "[-a] [-F format] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_list_windows_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -35,11 +35,14 @@ enum cmd_retval cmd_load_buffer_exec(struct cmd *, struct cmd_q *);
void cmd_load_buffer_callback(struct client *, int, void *); void cmd_load_buffer_callback(struct client *, int, void *);
const struct cmd_entry cmd_load_buffer_entry = { const struct cmd_entry cmd_load_buffer_entry = {
"load-buffer", "loadb", .name = "load-buffer",
"b:", 1, 1, .alias = "loadb",
CMD_BUFFER_USAGE " path",
0, .args = { "b:", 1, 1 },
cmd_load_buffer_exec .usage = CMD_BUFFER_USAGE " path",
.flags = 0,
.exec = cmd_load_buffer_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,27 +27,36 @@
enum cmd_retval cmd_lock_server_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_lock_server_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_lock_server_entry = { const struct cmd_entry cmd_lock_server_entry = {
"lock-server", "lock", .name = "lock-server",
"", 0, 0, .alias = "lock",
"",
0, .args = { "", 0, 0 },
cmd_lock_server_exec .usage = "",
.flags = 0,
.exec = cmd_lock_server_exec
}; };
const struct cmd_entry cmd_lock_session_entry = { const struct cmd_entry cmd_lock_session_entry = {
"lock-session", "locks", .name = "lock-session",
"t:", 0, 0, .alias = "locks",
CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "t:", 0, 0 },
cmd_lock_server_exec .usage = CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_lock_server_exec
}; };
const struct cmd_entry cmd_lock_client_entry = { const struct cmd_entry cmd_lock_client_entry = {
"lock-client", "lockc", .name = "lock-client",
"t:", 0, 0, .alias = "lockc",
CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T, .args = { "t:", 0, 0 },
cmd_lock_server_exec .usage = CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_lock_server_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,19 +29,25 @@
enum cmd_retval cmd_move_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_move_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_move_window_entry = { const struct cmd_entry cmd_move_window_entry = {
"move-window", "movew", .name = "move-window",
"adkrs:t:", 0, 0, .alias = "movew",
"[-dkr] " CMD_SRCDST_WINDOW_USAGE,
CMD_WINDOW_S|CMD_MOVEW_R|CMD_INDEX_T, .args = { "adkrs:t:", 0, 0 },
cmd_move_window_exec .usage = "[-dkr] " CMD_SRCDST_WINDOW_USAGE,
.flags = CMD_WINDOW_S|CMD_MOVEW_R|CMD_INDEX_T,
.exec = cmd_move_window_exec
}; };
const struct cmd_entry cmd_link_window_entry = { const struct cmd_entry cmd_link_window_entry = {
"link-window", "linkw", .name = "link-window",
"adks:t:", 0, 0, .alias = "linkw",
"[-dk] " CMD_SRCDST_WINDOW_USAGE,
CMD_WINDOW_S|CMD_INDEX_T, .args = { "adks:t:", 0, 0 },
cmd_move_window_exec .usage = "[-dk] " CMD_SRCDST_WINDOW_USAGE,
.flags = CMD_WINDOW_S|CMD_INDEX_T,
.exec = cmd_move_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -36,21 +36,27 @@
enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_session_entry = { const struct cmd_entry cmd_new_session_entry = {
"new-session", "new", .name = "new-session",
"Ac:dDEF:n:Ps:t:x:y:", 0, -1, .alias = "new",
"[-AdDEP] [-c start-directory] [-F format] [-n window-name] "
"[-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] " .args = { "Ac:dDEF:n:Ps:t:x:y:", 0, -1 },
"[-y height] [command]", .usage = "[-AdDEP] [-c start-directory] [-F format] [-n window-name] "
CMD_STARTSERVER|CMD_CANFAIL|CMD_SESSION_T, "[-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] "
cmd_new_session_exec "[-y height] [command]",
.flags = CMD_STARTSERVER|CMD_CANFAIL|CMD_SESSION_T,
.exec = cmd_new_session_exec
}; };
const struct cmd_entry cmd_has_session_entry = { const struct cmd_entry cmd_has_session_entry = {
"has-session", "has", .name = "has-session",
"t:", 0, 0, .alias = "has",
CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "t:", 0, 0 },
cmd_new_session_exec .usage = CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_new_session_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -35,12 +35,15 @@
enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_window_entry = { const struct cmd_entry cmd_new_window_entry = {
"new-window", "neww", .name = "new-window",
"ac:dF:kn:Pt:", 0, -1, .alias = "neww",
"[-adkP] [-c start-directory] [-F format] [-n window-name] "
CMD_TARGET_WINDOW_USAGE " [command]", .args = { "ac:dF:kn:Pt:", 0, -1 },
CMD_INDEX_T, .usage = "[-adkP] [-c start-directory] [-F format] [-n window-name] "
cmd_new_window_exec CMD_TARGET_WINDOW_USAGE " [command]",
.flags = CMD_INDEX_T,
.exec = cmd_new_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -34,11 +34,15 @@ void cmd_paste_buffer_filter(struct window_pane *,
const char *, size_t, const char *, int); const char *, size_t, const char *, int);
const struct cmd_entry cmd_paste_buffer_entry = { const struct cmd_entry cmd_paste_buffer_entry = {
"paste-buffer", "pasteb", .name = "paste-buffer",
"db:prs:t:", 0, 0, .alias = "pasteb",
"[-dpr] [-s separator] " CMD_BUFFER_USAGE " " CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "db:prs:t:", 0, 0 },
cmd_paste_buffer_exec .usage = "[-dpr] [-s separator] " CMD_BUFFER_USAGE " "
CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_paste_buffer_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -38,11 +38,14 @@ enum cmd_retval cmd_pipe_pane_exec(struct cmd *, struct cmd_q *);
void cmd_pipe_pane_error_callback(struct bufferevent *, short, void *); void cmd_pipe_pane_error_callback(struct bufferevent *, short, void *);
const struct cmd_entry cmd_pipe_pane_entry = { const struct cmd_entry cmd_pipe_pane_entry = {
"pipe-pane", "pipep", .name = "pipe-pane",
"ot:", 0, 1, .alias = "pipep",
"[-o] " CMD_TARGET_PANE_USAGE " [command]",
CMD_PANE_T, .args = { "ot:", 0, 1 },
cmd_pipe_pane_exec .usage = "[-o] " CMD_TARGET_PANE_USAGE " [command]",
.flags = CMD_PANE_T,
.exec = cmd_pipe_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,11 +27,14 @@
enum cmd_retval cmd_refresh_client_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_refresh_client_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_refresh_client_entry = { const struct cmd_entry cmd_refresh_client_entry = {
"refresh-client", "refresh", .name = "refresh-client",
"C:St:", 0, 0, .alias = "refresh",
"[-S] [-C size] " CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T, .args = { "C:St:", 0, 0 },
cmd_refresh_client_exec .usage = "[-S] [-C size] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_refresh_client_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_rename_session_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_rename_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_rename_session_entry = { const struct cmd_entry cmd_rename_session_entry = {
"rename-session", "rename", .name = "rename-session",
"t:", 1, 1, .alias = "rename",
CMD_TARGET_SESSION_USAGE " new-name",
CMD_SESSION_T, .args = { "t:", 1, 1 },
cmd_rename_session_exec .usage = CMD_TARGET_SESSION_USAGE " new-name",
.flags = CMD_SESSION_T,
.exec = cmd_rename_session_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_rename_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_rename_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_rename_window_entry = { const struct cmd_entry cmd_rename_window_entry = {
"rename-window", "renamew", .name = "rename-window",
"t:", 1, 1, .alias = "renamew",
CMD_TARGET_WINDOW_USAGE " new-name",
CMD_WINDOW_T, .args = { "t:", 1, 1 },
cmd_rename_window_exec .usage = CMD_TARGET_WINDOW_USAGE " new-name",
.flags = CMD_WINDOW_T,
.exec = cmd_rename_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -31,11 +31,15 @@ enum cmd_retval cmd_resize_pane_exec(struct cmd *, struct cmd_q *);
void cmd_resize_pane_mouse_update(struct client *, struct mouse_event *); void cmd_resize_pane_mouse_update(struct client *, struct mouse_event *);
const struct cmd_entry cmd_resize_pane_entry = { const struct cmd_entry cmd_resize_pane_entry = {
"resize-pane", "resizep", .name = "resize-pane",
"DLMRt:Ux:y:Z", 0, 1, .alias = "resizep",
"[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " [adjustment]",
CMD_PANE_T, .args = { "DLMRt:Ux:y:Z", 0, 1 },
cmd_resize_pane_exec .usage = "[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " "
"[adjustment]",
.flags = CMD_PANE_T,
.exec = cmd_resize_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -31,11 +31,14 @@
enum cmd_retval cmd_respawn_pane_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_respawn_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_respawn_pane_entry = { const struct cmd_entry cmd_respawn_pane_entry = {
"respawn-pane", "respawnp", .name = "respawn-pane",
"kt:", 0, -1, .alias = "respawnp",
"[-k] " CMD_TARGET_PANE_USAGE " [command]",
CMD_PANE_T, .args = { "kt:", 0, -1 },
cmd_respawn_pane_exec .usage = "[-k] " CMD_TARGET_PANE_USAGE " [command]",
.flags = CMD_PANE_T,
.exec = cmd_respawn_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,11 +30,14 @@
enum cmd_retval cmd_respawn_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_respawn_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_respawn_window_entry = { const struct cmd_entry cmd_respawn_window_entry = {
"respawn-window", "respawnw", .name = "respawn-window",
"kt:", 0, -1, .alias = "respawnw",
"[-k] " CMD_TARGET_WINDOW_USAGE " [command]",
CMD_WINDOW_T, .args = { "kt:", 0, -1 },
cmd_respawn_window_exec .usage = "[-k] " CMD_TARGET_WINDOW_USAGE " [command]",
.flags = CMD_WINDOW_T,
.exec = cmd_respawn_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,11 +27,14 @@
enum cmd_retval cmd_rotate_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_rotate_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_rotate_window_entry = { const struct cmd_entry cmd_rotate_window_entry = {
"rotate-window", "rotatew", .name = "rotate-window",
"Dt:U", 0, 0, .alias = "rotatew",
"[-DU] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "Dt:U", 0, 0 },
cmd_rotate_window_exec .usage = "[-DU] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_rotate_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -36,11 +36,14 @@ void cmd_run_shell_free(void *);
void cmd_run_shell_print(struct job *, const char *); void cmd_run_shell_print(struct job *, const char *);
const struct cmd_entry cmd_run_shell_entry = { const struct cmd_entry cmd_run_shell_entry = {
"run-shell", "run", .name = "run-shell",
"bt:", 1, 1, .alias = "run",
"[-b] " CMD_TARGET_PANE_USAGE " shell-command",
CMD_PANE_T|CMD_CANFAIL, .args = { "bt:", 1, 1 },
cmd_run_shell_exec .usage = "[-b] " CMD_TARGET_PANE_USAGE " shell-command",
.flags = CMD_PANE_T|CMD_CANFAIL,
.exec = cmd_run_shell_exec
}; };
struct cmd_run_shell_data { struct cmd_run_shell_data {

View File

@ -35,19 +35,25 @@
enum cmd_retval cmd_save_buffer_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_save_buffer_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_save_buffer_entry = { const struct cmd_entry cmd_save_buffer_entry = {
"save-buffer", "saveb", .name = "save-buffer",
"ab:", 1, 1, .alias = "saveb",
"[-a] " CMD_BUFFER_USAGE " path",
0, .args = { "ab:", 1, 1 },
cmd_save_buffer_exec .usage = "[-a] " CMD_BUFFER_USAGE " path",
.flags = 0,
.exec = cmd_save_buffer_exec
}; };
const struct cmd_entry cmd_show_buffer_entry = { const struct cmd_entry cmd_show_buffer_entry = {
"show-buffer", "showb", .name = "show-buffer",
"b:", 0, 0, .alias = "showb",
CMD_BUFFER_USAGE,
0, .args = { "b:", 0, 0 },
cmd_save_buffer_exec .usage = CMD_BUFFER_USAGE,
.flags = 0,
.exec = cmd_save_buffer_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,27 +29,36 @@
enum cmd_retval cmd_select_layout_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_select_layout_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_select_layout_entry = { const struct cmd_entry cmd_select_layout_entry = {
"select-layout", "selectl", .name = "select-layout",
"nopt:", 0, 1, .alias = "selectl",
"[-nop] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
CMD_WINDOW_T, .args = { "nopt:", 0, 1 },
cmd_select_layout_exec .usage = "[-nop] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
.flags = CMD_WINDOW_T,
.exec = cmd_select_layout_exec
}; };
const struct cmd_entry cmd_next_layout_entry = { const struct cmd_entry cmd_next_layout_entry = {
"next-layout", "nextl", .name = "next-layout",
"t:", 0, 0, .alias = "nextl",
CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "t:", 0, 0 },
cmd_select_layout_exec .usage = CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_select_layout_exec
}; };
const struct cmd_entry cmd_previous_layout_entry = { const struct cmd_entry cmd_previous_layout_entry = {
"previous-layout", "prevl", .name = "previous-layout",
"t:", 0, 0, .alias = "prevl",
CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "t:", 0, 0 },
cmd_select_layout_exec .usage = CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_select_layout_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -27,19 +27,25 @@
enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_select_pane_entry = { const struct cmd_entry cmd_select_pane_entry = {
"select-pane", "selectp", .name = "select-pane",
"DdegLlMmP:Rt:U", 0, 0, .alias = "selectp",
"[-DdegLlMmRU] [-P style] " CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "DdegLlMmP:Rt:U", 0, 0 },
cmd_select_pane_exec .usage = "[-DdegLlMmRU] [-P style] " CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_select_pane_exec
}; };
const struct cmd_entry cmd_last_pane_entry = { const struct cmd_entry cmd_last_pane_entry = {
"last-pane", "lastp", .name = "last-pane",
"det:", 0, 0, .alias = "lastp",
"[-de] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "det:", 0, 0 },
cmd_select_pane_exec .usage = "[-de] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_select_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,35 +29,47 @@
enum cmd_retval cmd_select_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_select_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_select_window_entry = { const struct cmd_entry cmd_select_window_entry = {
"select-window", "selectw", .name = "select-window",
"lnpTt:", 0, 0, .alias = "selectw",
"[-lnpT] " CMD_TARGET_WINDOW_USAGE,
CMD_WINDOW_T, .args = { "lnpTt:", 0, 0 },
cmd_select_window_exec .usage = "[-lnpT] " CMD_TARGET_WINDOW_USAGE,
.flags = CMD_WINDOW_T,
.exec = cmd_select_window_exec
}; };
const struct cmd_entry cmd_next_window_entry = { const struct cmd_entry cmd_next_window_entry = {
"next-window", "next", .name = "next-window",
"at:", 0, 0, .alias = "next",
"[-a] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "at:", 0, 0 },
cmd_select_window_exec .usage = "[-a] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_select_window_exec
}; };
const struct cmd_entry cmd_previous_window_entry = { const struct cmd_entry cmd_previous_window_entry = {
"previous-window", "prev", .name = "previous-window",
"at:", 0, 0, .alias = "prev",
"[-a] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "at:", 0, 0 },
cmd_select_window_exec .usage = "[-a] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_select_window_exec
}; };
const struct cmd_entry cmd_last_window_entry = { const struct cmd_entry cmd_last_window_entry = {
"last-window", "last", .name = "last-window",
"t:", 0, 0, .alias = "last",
CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "t:", 0, 0 },
cmd_select_window_exec .usage = CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_select_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,19 +30,25 @@
enum cmd_retval cmd_send_keys_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_send_keys_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_send_keys_entry = { const struct cmd_entry cmd_send_keys_entry = {
"send-keys", "send", .name = "send-keys",
"lRMt:", 0, -1, .alias = "send",
"[-lRM] " CMD_TARGET_PANE_USAGE " key ...",
CMD_PANE_T, .args = { "lRMt:", 0, -1 },
cmd_send_keys_exec .usage = "[-lRM] " CMD_TARGET_PANE_USAGE " key ...",
.flags = CMD_PANE_T,
.exec = cmd_send_keys_exec
}; };
const struct cmd_entry cmd_send_prefix_entry = { const struct cmd_entry cmd_send_prefix_entry = {
"send-prefix", NULL, .name = "send-prefix",
"2t:", 0, 0, .alias = NULL,
"[-2] " CMD_TARGET_PANE_USAGE,
CMD_PANE_T, .args = { "2t:", 0, 0 },
cmd_send_keys_exec .usage = "[-2] " CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_send_keys_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,19 +30,25 @@
enum cmd_retval cmd_set_buffer_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_set_buffer_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_set_buffer_entry = { const struct cmd_entry cmd_set_buffer_entry = {
"set-buffer", "setb", .name = "set-buffer",
"ab:n:", 0, 1, .alias = "setb",
"[-a] " CMD_BUFFER_USAGE " [-n new-buffer-name] data",
0, .args = { "ab:n:", 0, 1 },
cmd_set_buffer_exec .usage = "[-a] " CMD_BUFFER_USAGE " [-n new-buffer-name] data",
.flags = 0,
.exec = cmd_set_buffer_exec
}; };
const struct cmd_entry cmd_delete_buffer_entry = { const struct cmd_entry cmd_delete_buffer_entry = {
"delete-buffer", "deleteb", .name = "delete-buffer",
"b:", 0, 0, .alias = "deleteb",
CMD_BUFFER_USAGE,
0, .args = { "b:", 0, 0 },
cmd_set_buffer_exec .usage = CMD_BUFFER_USAGE,
.flags = 0,
.exec = cmd_set_buffer_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,11 +30,14 @@
enum cmd_retval cmd_set_environment_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_set_environment_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_set_environment_entry = { const struct cmd_entry cmd_set_environment_entry = {
"set-environment", "setenv", .name = "set-environment",
"grt:u", 1, 2, .alias = "setenv",
"[-gru] " CMD_TARGET_SESSION_USAGE " name [value]",
CMD_SESSION_T, .args = { "grt:u", 1, 2 },
cmd_set_environment_exec .usage = "[-gru] " CMD_TARGET_SESSION_USAGE " name [value]",
.flags = CMD_SESSION_T,
.exec = cmd_set_environment_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,19 +30,25 @@
enum cmd_retval cmd_set_hook_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_set_hook_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_set_hook_entry = { const struct cmd_entry cmd_set_hook_entry = {
"set-hook", NULL, .name = "set-hook",
"gt:u", 1, 2, .alias = NULL,
"[-gu] " CMD_TARGET_SESSION_USAGE " hook-name [command]",
CMD_SESSION_T, .args = { "gt:u", 1, 2 },
cmd_set_hook_exec .usage = "[-gu] " CMD_TARGET_SESSION_USAGE " hook-name [command]",
.flags = CMD_SESSION_T,
.exec = cmd_set_hook_exec
}; };
const struct cmd_entry cmd_show_hooks_entry = { const struct cmd_entry cmd_show_hooks_entry = {
"show-hooks", NULL, .name = "show-hooks",
"gt:", 0, 1, .alias = NULL,
"[-g] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T, .args = { "gt:", 0, 1 },
cmd_set_hook_exec .usage = "[-g] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_set_hook_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -65,19 +65,25 @@ struct options_entry *cmd_set_option_style(struct cmd *, struct cmd_q *,
const char *); const char *);
const struct cmd_entry cmd_set_option_entry = { const struct cmd_entry cmd_set_option_entry = {
"set-option", "set", .name = "set-option",
"agoqst:uw", 1, 2, .alias = "set",
"[-agosquw] [-t target-window] option [value]",
CMD_WINDOW_T|CMD_CANFAIL, .args = { "agoqst:uw", 1, 2 },
cmd_set_option_exec .usage = "[-agosquw] [-t target-window] option [value]",
.flags = CMD_WINDOW_T|CMD_CANFAIL,
.exec = cmd_set_option_exec
}; };
const struct cmd_entry cmd_set_window_option_entry = { const struct cmd_entry cmd_set_window_option_entry = {
"set-window-option", "setw", .name = "set-window-option",
"agoqt:u", 1, 2, .alias = "setw",
"[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
CMD_WINDOW_T|CMD_CANFAIL, .args = { "agoqt:u", 1, 2 },
cmd_set_option_exec .usage = "[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
.flags = CMD_WINDOW_T|CMD_CANFAIL,
.exec = cmd_set_option_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -34,11 +34,14 @@ void cmd_show_environment_print(struct cmd *, struct cmd_q *,
struct environ_entry *); struct environ_entry *);
const struct cmd_entry cmd_show_environment_entry = { const struct cmd_entry cmd_show_environment_entry = {
"show-environment", "showenv", .name = "show-environment",
"gst:", 0, 1, .alias = "showenv",
"[-gs] " CMD_TARGET_SESSION_USAGE " [name]",
CMD_SESSION_T|CMD_CANFAIL, .args = { "gst:", 0, 1 },
cmd_show_environment_exec .usage = "[-gs] " CMD_TARGET_SESSION_USAGE " [name]",
.flags = CMD_SESSION_T|CMD_CANFAIL,
.exec = cmd_show_environment_exec
}; };
char * char *

View File

@ -32,19 +32,25 @@
enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_show_messages_entry = { const struct cmd_entry cmd_show_messages_entry = {
"show-messages", "showmsgs", .name = "show-messages",
"JTt:", 0, 0, .alias = "showmsgs",
"[-JT] " CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T, .args = { "JTt:", 0, 0 },
cmd_show_messages_exec .usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_show_messages_exec
}; };
const struct cmd_entry cmd_server_info_entry = { const struct cmd_entry cmd_server_info_entry = {
"server-info", "info", .name = "server-info",
"", 0, 0, .alias = "info",
"",
0, .args = { "", 0, 0 },
cmd_show_messages_exec .usage = "",
.flags = 0,
.exec = cmd_show_messages_exec
}; };
int cmd_show_messages_terminals(struct cmd_q *, int); int cmd_show_messages_terminals(struct cmd_q *, int);

View File

@ -35,19 +35,25 @@ enum cmd_retval cmd_show_options_all(struct cmd *, struct cmd_q *,
struct options *, enum options_table_scope); struct options *, enum options_table_scope);
const struct cmd_entry cmd_show_options_entry = { const struct cmd_entry cmd_show_options_entry = {
"show-options", "show", .name = "show-options",
"gqst:vw", 0, 1, .alias = "show",
"[-gqsvw] [-t target-session|target-window] [option]",
CMD_WINDOW_T|CMD_CANFAIL, .args = { "gqst:vw", 0, 1 },
cmd_show_options_exec .usage = "[-gqsvw] [-t target-session|target-window] [option]",
.flags = CMD_WINDOW_T|CMD_CANFAIL,
.exec = cmd_show_options_exec
}; };
const struct cmd_entry cmd_show_window_options_entry = { const struct cmd_entry cmd_show_window_options_entry = {
"show-window-options", "showw", .name = "show-window-options",
"gvt:", 0, 1, .alias = "showw",
"[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
CMD_WINDOW_T|CMD_CANFAIL, .args = { "gvt:", 0, 1 },
cmd_show_options_exec .usage = "[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
.flags = CMD_WINDOW_T|CMD_CANFAIL,
.exec = cmd_show_options_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -31,11 +31,14 @@ enum cmd_retval cmd_source_file_exec(struct cmd *, struct cmd_q *);
void cmd_source_file_done(struct cmd_q *); void cmd_source_file_done(struct cmd_q *);
const struct cmd_entry cmd_source_file_entry = { const struct cmd_entry cmd_source_file_entry = {
"source-file", "source", .name = "source-file",
"", 1, 1, .alias = "source",
"path",
0, .args = { "", 1, 1 },
cmd_source_file_exec .usage = "path",
.flags = 0,
.exec = cmd_source_file_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -36,12 +36,15 @@
enum cmd_retval cmd_split_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_split_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_split_window_entry = { const struct cmd_entry cmd_split_window_entry = {
"split-window", "splitw", .name = "split-window",
"bc:dF:l:hp:Pt:v", 0, -1, .alias = "splitw",
"[-bdhvP] [-c start-directory] [-F format] [-p percentage|-l size] "
CMD_TARGET_PANE_USAGE " [command]", .args = { "bc:dF:l:hp:Pt:v", 0, -1 },
CMD_PANE_T, .usage = "[-bdhvP] [-c start-directory] [-F format] "
cmd_split_window_exec "[-p percentage|-l size] " CMD_TARGET_PANE_USAGE " [command]",
.flags = CMD_PANE_T,
.exec = cmd_split_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_swap_pane_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_swap_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_swap_pane_entry = { const struct cmd_entry cmd_swap_pane_entry = {
"swap-pane", "swapp", .name = "swap-pane",
"dDs:t:U", 0, 0, .alias = "swapp",
"[-dDU] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_MARKED_S|CMD_PANE_T, .args = { "dDs:t:U", 0, 0 },
cmd_swap_pane_exec .usage = "[-dDU] " CMD_SRCDST_PANE_USAGE,
.flags = CMD_PANE_MARKED_S|CMD_PANE_T,
.exec = cmd_swap_pane_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_swap_window_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_swap_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_swap_window_entry = { const struct cmd_entry cmd_swap_window_entry = {
"swap-window", "swapw", .name = "swap-window",
"ds:t:", 0, 0, .alias = "swapw",
"[-d] " CMD_SRCDST_WINDOW_USAGE,
CMD_WINDOW_MARKED_S|CMD_WINDOW_MARKED_T, .args = { "ds:t:", 0, 0 },
cmd_swap_window_exec .usage = "[-d] " CMD_SRCDST_WINDOW_USAGE,
.flags = CMD_WINDOW_MARKED_S|CMD_WINDOW_MARKED_T,
.exec = cmd_swap_window_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -30,11 +30,16 @@
enum cmd_retval cmd_switch_client_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_switch_client_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_switch_client_entry = { const struct cmd_entry cmd_switch_client_entry = {
"switch-client", "switchc", .name = "switch-client",
"lc:Enpt:rT:", 0, 0, .alias = "switchc",
"[-Elnpr] [-c target-client] [-t target-session] [-T key-table]",
CMD_READONLY|CMD_CLIENT_C|CMD_PANE_T|CMD_SESSION_T|CMD_PREFERUNATTACHED, .args = { "lc:Enpt:rT:", 0, 0 },
cmd_switch_client_exec .usage = "[-Elnpr] [-c target-client] [-t target-session] "
"[-T key-table]",
.flags = CMD_READONLY|CMD_CLIENT_C|CMD_PANE_T|CMD_SESSION_T|
CMD_PREFERUNATTACHED,
.exec = cmd_switch_client_exec
}; };
enum cmd_retval enum cmd_retval
@ -48,7 +53,6 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
const char *tablename, *update; const char *tablename, *update;
struct key_table *table; struct key_table *table;
if (args_has(args, 'r')) if (args_has(args, 'r'))
c->flags ^= CLIENT_READONLY; c->flags ^= CLIENT_READONLY;

View File

@ -31,11 +31,14 @@ enum cmd_retval cmd_unbind_key_mode_table(struct cmd *, struct cmd_q *,
key_code); key_code);
const struct cmd_entry cmd_unbind_key_entry = { const struct cmd_entry cmd_unbind_key_entry = {
"unbind-key", "unbind", .name = "unbind-key",
"acnt:T:", 0, 1, .alias = "unbind",
"[-acn] [-t mode-table] [-T key-table] key",
0, .args = { "acnt:T:", 0, 1 },
cmd_unbind_key_exec .usage = "[-acn] [-t mode-table] [-T key-table] key",
.flags = 0,
.exec = cmd_unbind_key_exec
}; };
enum cmd_retval enum cmd_retval

View File

@ -31,11 +31,14 @@
enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_wait_for_entry = { const struct cmd_entry cmd_wait_for_entry = {
"wait-for", "wait", .name = "wait-for",
"LSU", 1, 1, .alias = "wait",
"[-L|-S|-U] channel",
0, .args = { "LSU", 1, 1 },
cmd_wait_for_exec .usage = "[-L|-S|-U] channel",
.flags = 0,
.exec = cmd_wait_for_exec
}; };
struct wait_channel { struct wait_channel {

6
cmd.c
View File

@ -353,12 +353,12 @@ cmd_parse(int argc, char **argv, const char *file, u_int line, char **cause)
return (NULL); return (NULL);
} }
args = args_parse(entry->args_template, argc, argv); args = args_parse(entry->args.template, argc, argv);
if (args == NULL) if (args == NULL)
goto usage; goto usage;
if (entry->args_lower != -1 && args->argc < entry->args_lower) if (entry->args.lower != -1 && args->argc < entry->args.lower)
goto usage; goto usage;
if (entry->args_upper != -1 && args->argc > entry->args_upper) if (entry->args.upper != -1 && args->argc > entry->args.upper)
goto usage; goto usage;
cmd = xcalloc(1, sizeof *cmd); cmd = xcalloc(1, sizeof *cmd);

18
tmux.h
View File

@ -1389,14 +1389,16 @@ struct cmd_q {
/* Command definition. */ /* Command definition. */
struct cmd_entry { struct cmd_entry {
const char *name; const char *name;
const char *alias; const char *alias;
const char *args_template; struct {
int args_lower; const char *template;
int args_upper; int lower;
int upper;
} args;
const char *usage; const char *usage;
#define CMD_STARTSERVER 0x1 #define CMD_STARTSERVER 0x1
#define CMD_READONLY 0x2 #define CMD_READONLY 0x2
@ -1418,9 +1420,9 @@ struct cmd_entry {
#define CMD_WINDOW_MARKED_T 0x20000 #define CMD_WINDOW_MARKED_T 0x20000
#define CMD_WINDOW_MARKED_S 0x40000 #define CMD_WINDOW_MARKED_S 0x40000
#define CMD_CLIENT_CANFAIL 0x80000 #define CMD_CLIENT_CANFAIL 0x80000
int flags; int flags;
enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); enum cmd_retval (*exec)(struct cmd *, struct cmd_q *);
}; };
#define CMD_ALL_T (CMD_SESSION_T|CMD_WINDOW_T|CMD_PANE_T|CMD_INDEX_T| \ #define CMD_ALL_T (CMD_SESSION_T|CMD_WINDOW_T|CMD_PANE_T|CMD_INDEX_T| \
CMD_MOVEW_R|CMD_PANE_MARKED_T|CMD_WINDOW_MARKED_T) CMD_MOVEW_R|CMD_PANE_MARKED_T|CMD_WINDOW_MARKED_T)