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 *);
const struct cmd_entry cmd_attach_session_entry = {
"attach-session", "attach",
"c:dErt:", 0, 0,
"[-dEr] [-c working-directory] " CMD_TARGET_SESSION_USAGE,
CMD_STARTSERVER|CMD_SESSION_T|CMD_PANE_T|CMD_PREFERUNATTACHED,
cmd_attach_session_exec
.name = "attach-session",
.alias = "attach",
.args = { "c:dErt:", 0, 0 },
.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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,11 +35,15 @@ int cmd_command_prompt_callback(void *, const char *);
void cmd_command_prompt_free(void *);
const struct cmd_entry cmd_command_prompt_entry = {
"command-prompt", NULL,
"I:p:t:", 0, 1,
"[-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " [template]",
CMD_CLIENT_T,
cmd_command_prompt_exec
.name = "command-prompt",
.alias = NULL,
.args = { "I:p:t:", 0, 1 },
.usage = "[-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
"[template]",
.flags = CMD_CLIENT_T,
.exec = cmd_command_prompt_exec
};
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 *);
const struct cmd_entry cmd_confirm_before_entry = {
"confirm-before", "confirm",
"p:t:", 1, 1,
"[-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
CMD_CLIENT_T,
cmd_confirm_before_exec
.name = "confirm-before",
.alias = "confirm",
.args = { "p:t:", 1, 1 },
.usage = "[-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
.flags = CMD_CLIENT_T,
.exec = cmd_confirm_before_exec
};
struct cmd_confirm_before_data {

View File

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

View File

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

View File

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

View File

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

View File

@ -48,11 +48,14 @@ void cmd_find_window_callback(struct window_choose_data *);
CMD_FIND_WINDOW_BY_NAME)
const struct cmd_entry cmd_find_window_entry = {
"find-window", "findw",
"F:CNt:T", 1, 4,
"[-CNT] [-F format] " CMD_TARGET_WINDOW_USAGE " match-string",
CMD_WINDOW_T,
cmd_find_window_exec
.name = "find-window",
.alias = "findw",
.args = { "F:CNt:T", 1, 4 },
.usage = "[-CNT] [-F format] " CMD_TARGET_WINDOW_USAGE " match-string",
.flags = CMD_WINDOW_T,
.exec = cmd_find_window_exec
};
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 *);
const struct cmd_entry cmd_if_shell_entry = {
"if-shell", "if",
"bFt:", 2, 3,
"[-bF] " CMD_TARGET_PANE_USAGE " shell-command command [command]",
CMD_PANE_T|CMD_CANFAIL,
cmd_if_shell_exec
.name = "if-shell",
.alias = "if",
.args = { "bFt:", 2, 3 },
.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 {

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);
const struct cmd_entry cmd_join_pane_entry = {
"join-pane", "joinp",
"bdhvp:l:s:t:", 0, 0,
"[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_MARKED_S|CMD_PANE_T,
cmd_join_pane_exec
.name = "join-pane",
.alias = "joinp",
.args = { "bdhvp:l:s:t:", 0, 0 },
.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 = {
"move-pane", "movep",
"bdhvp:l:s:t:", 0, 0,
"[-bdhv] [-p percentage|-l size] " CMD_SRCDST_PANE_USAGE,
CMD_PANE_S|CMD_PANE_T,
cmd_join_pane_exec
.name = "move-pane",
.alias = "movep",
.args = { "bdhvp:l:s:t:", 0, 0 },
.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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,11 +36,14 @@
enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_clients_entry = {
"list-clients", "lsc",
"F:t:", 0, 0,
"[-F format] " CMD_TARGET_SESSION_USAGE,
CMD_READONLY|CMD_SESSION_T,
cmd_list_clients_exec
.name = "list-clients",
.alias = "lsc",
.args = { "F:t:", 0, 0 },
.usage = "[-F format] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_READONLY|CMD_SESSION_T,
.exec = cmd_list_clients_exec
};
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 *);
const struct cmd_entry cmd_list_keys_entry = {
"list-keys", "lsk",
"t:T:", 0, 0,
"[-t mode-table] [-T key-table]",
0,
cmd_list_keys_exec
.name = "list-keys",
.alias = "lsk",
.args = { "t:T:", 0, 0 },
.usage = "[-t mode-table] [-T key-table]",
.flags = 0,
.exec = cmd_list_keys_exec
};
const struct cmd_entry cmd_list_commands_entry = {
"list-commands", "lscm",
"", 0, 0,
"",
0,
cmd_list_keys_exec
.name = "list-commands",
.alias = "lscm",
.args = { "", 0, 0 },
.usage = "",
.flags = 0,
.exec = cmd_list_keys_exec
};
enum cmd_retval

View File

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

View File

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

View File

@ -46,11 +46,14 @@ void cmd_list_windows_session(struct cmd *, struct session *,
struct cmd_q *, int);
const struct cmd_entry cmd_list_windows_entry = {
"list-windows", "lsw",
"F:at:", 0, 0,
"[-a] [-F format] " CMD_TARGET_SESSION_USAGE,
CMD_SESSION_T,
cmd_list_windows_exec
.name = "list-windows",
.alias = "lsw",
.args = { "F:at:", 0, 0 },
.usage = "[-a] [-F format] " CMD_TARGET_SESSION_USAGE,
.flags = CMD_SESSION_T,
.exec = cmd_list_windows_exec
};
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 *);
const struct cmd_entry cmd_load_buffer_entry = {
"load-buffer", "loadb",
"b:", 1, 1,
CMD_BUFFER_USAGE " path",
0,
cmd_load_buffer_exec
.name = "load-buffer",
.alias = "loadb",
.args = { "b:", 1, 1 },
.usage = CMD_BUFFER_USAGE " path",
.flags = 0,
.exec = cmd_load_buffer_exec
};
enum cmd_retval

View File

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

View File

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

View File

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

View File

@ -35,12 +35,15 @@
enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_window_entry = {
"new-window", "neww",
"ac:dF:kn:Pt:", 0, -1,
"[-adkP] [-c start-directory] [-F format] [-n window-name] "
CMD_TARGET_WINDOW_USAGE " [command]",
CMD_INDEX_T,
cmd_new_window_exec
.name = "new-window",
.alias = "neww",
.args = { "ac:dF:kn:Pt:", 0, -1 },
.usage = "[-adkP] [-c start-directory] [-F format] [-n window-name] "
CMD_TARGET_WINDOW_USAGE " [command]",
.flags = CMD_INDEX_T,
.exec = cmd_new_window_exec
};
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 struct cmd_entry cmd_paste_buffer_entry = {
"paste-buffer", "pasteb",
"db:prs:t:", 0, 0,
"[-dpr] [-s separator] " CMD_BUFFER_USAGE " " CMD_TARGET_PANE_USAGE,
CMD_PANE_T,
cmd_paste_buffer_exec
.name = "paste-buffer",
.alias = "pasteb",
.args = { "db:prs:t:", 0, 0 },
.usage = "[-dpr] [-s separator] " CMD_BUFFER_USAGE " "
CMD_TARGET_PANE_USAGE,
.flags = CMD_PANE_T,
.exec = cmd_paste_buffer_exec
};
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 *);
const struct cmd_entry cmd_pipe_pane_entry = {
"pipe-pane", "pipep",
"ot:", 0, 1,
"[-o] " CMD_TARGET_PANE_USAGE " [command]",
CMD_PANE_T,
cmd_pipe_pane_exec
.name = "pipe-pane",
.alias = "pipep",
.args = { "ot:", 0, 1 },
.usage = "[-o] " CMD_TARGET_PANE_USAGE " [command]",
.flags = CMD_PANE_T,
.exec = cmd_pipe_pane_exec
};
enum cmd_retval

View File

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

View File

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

View File

@ -29,11 +29,14 @@
enum cmd_retval cmd_rename_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_rename_window_entry = {
"rename-window", "renamew",
"t:", 1, 1,
CMD_TARGET_WINDOW_USAGE " new-name",
CMD_WINDOW_T,
cmd_rename_window_exec
.name = "rename-window",
.alias = "renamew",
.args = { "t:", 1, 1 },
.usage = CMD_TARGET_WINDOW_USAGE " new-name",
.flags = CMD_WINDOW_T,
.exec = cmd_rename_window_exec
};
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 *);
const struct cmd_entry cmd_resize_pane_entry = {
"resize-pane", "resizep",
"DLMRt:Ux:y:Z", 0, 1,
"[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " [adjustment]",
CMD_PANE_T,
cmd_resize_pane_exec
.name = "resize-pane",
.alias = "resizep",
.args = { "DLMRt:Ux:y:Z", 0, 1 },
.usage = "[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " "
"[adjustment]",
.flags = CMD_PANE_T,
.exec = cmd_resize_pane_exec
};
enum cmd_retval

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,19 +32,25 @@
enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_show_messages_entry = {
"show-messages", "showmsgs",
"JTt:", 0, 0,
"[-JT] " CMD_TARGET_CLIENT_USAGE,
CMD_CLIENT_T,
cmd_show_messages_exec
.name = "show-messages",
.alias = "showmsgs",
.args = { "JTt:", 0, 0 },
.usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_CLIENT_T,
.exec = cmd_show_messages_exec
};
const struct cmd_entry cmd_server_info_entry = {
"server-info", "info",
"", 0, 0,
"",
0,
cmd_show_messages_exec
.name = "server-info",
.alias = "info",
.args = { "", 0, 0 },
.usage = "",
.flags = 0,
.exec = cmd_show_messages_exec
};
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);
const struct cmd_entry cmd_show_options_entry = {
"show-options", "show",
"gqst:vw", 0, 1,
"[-gqsvw] [-t target-session|target-window] [option]",
CMD_WINDOW_T|CMD_CANFAIL,
cmd_show_options_exec
.name = "show-options",
.alias = "show",
.args = { "gqst:vw", 0, 1 },
.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 = {
"show-window-options", "showw",
"gvt:", 0, 1,
"[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
CMD_WINDOW_T|CMD_CANFAIL,
cmd_show_options_exec
.name = "show-window-options",
.alias = "showw",
.args = { "gvt:", 0, 1 },
.usage = "[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
.flags = CMD_WINDOW_T|CMD_CANFAIL,
.exec = cmd_show_options_exec
};
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 *);
const struct cmd_entry cmd_source_file_entry = {
"source-file", "source",
"", 1, 1,
"path",
0,
cmd_source_file_exec
.name = "source-file",
.alias = "source",
.args = { "", 1, 1 },
.usage = "path",
.flags = 0,
.exec = cmd_source_file_exec
};
enum cmd_retval

View File

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

View File

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

View File

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

View File

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

View File

@ -31,11 +31,14 @@
enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_wait_for_entry = {
"wait-for", "wait",
"LSU", 1, 1,
"[-L|-S|-U] channel",
0,
cmd_wait_for_exec
.name = "wait-for",
.alias = "wait",
.args = { "LSU", 1, 1 },
.usage = "[-L|-S|-U] channel",
.flags = 0,
.exec = cmd_wait_for_exec
};
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);
}
args = args_parse(entry->args_template, argc, argv);
args = args_parse(entry->args.template, argc, argv);
if (args == NULL)
goto usage;
if (entry->args_lower != -1 && args->argc < entry->args_lower)
if (entry->args.lower != -1 && args->argc < entry->args.lower)
goto usage;
if (entry->args_upper != -1 && args->argc > entry->args_upper)
if (entry->args.upper != -1 && args->argc > entry->args.upper)
goto usage;
cmd = xcalloc(1, sizeof *cmd);

18
tmux.h
View File

@ -1389,14 +1389,16 @@ struct cmd_q {
/* Command definition. */
struct cmd_entry {
const char *name;
const char *alias;
const char *name;
const char *alias;
const char *args_template;
int args_lower;
int args_upper;
struct {
const char *template;
int lower;
int upper;
} args;
const char *usage;
const char *usage;
#define CMD_STARTSERVER 0x1
#define CMD_READONLY 0x2
@ -1418,9 +1420,9 @@ struct cmd_entry {
#define CMD_WINDOW_MARKED_T 0x20000
#define CMD_WINDOW_MARKED_S 0x40000
#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| \
CMD_MOVEW_R|CMD_PANE_MARKED_T|CMD_WINDOW_MARKED_T)