mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Merge branch 'obsd-master' into master
This commit is contained in:
commit
62036121fa
21
arguments.c
21
arguments.c
@ -78,7 +78,7 @@ args_create(void)
|
|||||||
|
|
||||||
/* Parse an argv and argc into a new argument set. */
|
/* Parse an argv and argc into a new argument set. */
|
||||||
struct args *
|
struct args *
|
||||||
args_parse(const char *template, int argc, char **argv, int lower, int upper)
|
args_parse(const struct args_parse *parse, int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct args *args;
|
struct args *args;
|
||||||
int opt;
|
int opt;
|
||||||
@ -88,10 +88,10 @@ args_parse(const char *template, int argc, char **argv, int lower, int upper)
|
|||||||
optarg = NULL;
|
optarg = NULL;
|
||||||
|
|
||||||
args = args_create();
|
args = args_create();
|
||||||
while ((opt = getopt(argc, argv, template)) != -1) {
|
while ((opt = getopt(argc, argv, parse->template)) != -1) {
|
||||||
if (opt < 0)
|
if (opt < 0)
|
||||||
continue;
|
continue;
|
||||||
if (opt == '?' || strchr(template, opt) == NULL) {
|
if (opt == '?' || strchr(parse->template, opt) == NULL) {
|
||||||
args_free(args);
|
args_free(args);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -104,7 +104,8 @@ args_parse(const char *template, int argc, char **argv, int lower, int upper)
|
|||||||
args->argc = argc;
|
args->argc = argc;
|
||||||
args->argv = cmd_copy_argv(argc, argv);
|
args->argv = cmd_copy_argv(argc, argv);
|
||||||
|
|
||||||
if ((lower != -1 && argc < lower) || (upper != -1 && argc > upper)) {
|
if ((parse->lower != -1 && argc < parse->lower) ||
|
||||||
|
(parse->upper != -1 && argc > parse->upper)) {
|
||||||
args_free(args);
|
args_free(args);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -126,7 +127,7 @@ args_free(struct args *args)
|
|||||||
RB_REMOVE(args_tree, &args->tree, entry);
|
RB_REMOVE(args_tree, &args->tree, entry);
|
||||||
TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) {
|
TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) {
|
||||||
TAILQ_REMOVE(&entry->values, value, entry);
|
TAILQ_REMOVE(&entry->values, value, entry);
|
||||||
free(value->value);
|
free(value->string);
|
||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
free(entry);
|
free(entry);
|
||||||
@ -208,7 +209,7 @@ args_print(struct args *args)
|
|||||||
args_print_add(&buf, &len, " -%c", entry->flag);
|
args_print_add(&buf, &len, " -%c", entry->flag);
|
||||||
else
|
else
|
||||||
args_print_add(&buf, &len, "-%c", entry->flag);
|
args_print_add(&buf, &len, "-%c", entry->flag);
|
||||||
args_print_add_argument(&buf, &len, value->value);
|
args_print_add_argument(&buf, &len, value->string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +298,7 @@ args_set(struct args *args, u_char flag, const char *s)
|
|||||||
|
|
||||||
if (s != NULL) {
|
if (s != NULL) {
|
||||||
value = xcalloc(1, sizeof *value);
|
value = xcalloc(1, sizeof *value);
|
||||||
value->value = xstrdup(s);
|
value->string = xstrdup(s);
|
||||||
TAILQ_INSERT_TAIL(&entry->values, value, entry);
|
TAILQ_INSERT_TAIL(&entry->values, value, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,7 +313,7 @@ args_get(struct args *args, u_char flag)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
if (TAILQ_EMPTY(&entry->values))
|
if (TAILQ_EMPTY(&entry->values))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
return (TAILQ_LAST(&entry->values, args_values)->value);
|
return (TAILQ_LAST(&entry->values, args_values)->string);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get first argument. */
|
/* Get first argument. */
|
||||||
@ -385,7 +386,7 @@ args_strtonum(struct args *args, u_char flag, long long minval,
|
|||||||
}
|
}
|
||||||
value = TAILQ_LAST(&entry->values, args_values);
|
value = TAILQ_LAST(&entry->values, args_values);
|
||||||
|
|
||||||
ll = strtonum(value->value, minval, maxval, &errstr);
|
ll = strtonum(value->string, minval, maxval, &errstr);
|
||||||
if (errstr != NULL) {
|
if (errstr != NULL) {
|
||||||
*cause = xstrdup(errstr);
|
*cause = xstrdup(errstr);
|
||||||
return (0);
|
return (0);
|
||||||
@ -407,7 +408,7 @@ args_percentage(struct args *args, u_char flag, long long minval,
|
|||||||
*cause = xstrdup("missing");
|
*cause = xstrdup("missing");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
value = TAILQ_LAST(&entry->values, args_values)->value;
|
value = TAILQ_LAST(&entry->values, args_values)->string;
|
||||||
return (args_string_percentage(value, minval, maxval, curval, cause));
|
return (args_string_percentage(value, minval, maxval, curval, cause));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_attach_session_entry = {
|
|||||||
.name = "attach-session",
|
.name = "attach-session",
|
||||||
.alias = "attach",
|
.alias = "attach",
|
||||||
|
|
||||||
.args = { "c:dEf:rt:x", 0, 0 },
|
.args = { "c:dEf:rt:x", 0, 0, NULL },
|
||||||
.usage = "[-dErx] [-c working-directory] [-f flags] "
|
.usage = "[-dErx] [-c working-directory] [-f flags] "
|
||||||
CMD_TARGET_SESSION_USAGE,
|
CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_bind_key_entry = {
|
|||||||
.name = "bind-key",
|
.name = "bind-key",
|
||||||
.alias = "bind",
|
.alias = "bind",
|
||||||
|
|
||||||
.args = { "nrN:T:", 1, -1 },
|
.args = { "nrN:T:", 1, -1, NULL },
|
||||||
.usage = "[-nr] [-T key-table] [-N note] key "
|
.usage = "[-nr] [-T key-table] [-N note] key "
|
||||||
"[command [arguments]]",
|
"[command [arguments]]",
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_break_pane_entry = {
|
|||||||
.name = "break-pane",
|
.name = "break-pane",
|
||||||
.alias = "breakp",
|
.alias = "breakp",
|
||||||
|
|
||||||
.args = { "abdPF:n:s:t:", 0, 0 },
|
.args = { "abdPF:n:s:t:", 0, 0, NULL },
|
||||||
.usage = "[-abdP] [-F format] [-n window-name] [-s src-pane] "
|
.usage = "[-abdP] [-F format] [-n window-name] [-s src-pane] "
|
||||||
"[-t dst-window]",
|
"[-t dst-window]",
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_capture_pane_entry = {
|
|||||||
.name = "capture-pane",
|
.name = "capture-pane",
|
||||||
.alias = "capturep",
|
.alias = "capturep",
|
||||||
|
|
||||||
.args = { "ab:CeE:JNpPqS:t:", 0, 0 },
|
.args = { "ab:CeE:JNpPqS:t:", 0, 0, NULL },
|
||||||
.usage = "[-aCeJNpPq] " CMD_BUFFER_USAGE " [-E end-line] "
|
.usage = "[-aCeJNpPq] " CMD_BUFFER_USAGE " [-E end-line] "
|
||||||
"[-S start-line] " CMD_TARGET_PANE_USAGE,
|
"[-S start-line] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ const struct cmd_entry cmd_clear_history_entry = {
|
|||||||
.name = "clear-history",
|
.name = "clear-history",
|
||||||
.alias = "clearhist",
|
.alias = "clearhist",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_PANE_USAGE,
|
.usage = CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -30,7 +30,7 @@ const struct cmd_entry cmd_choose_tree_entry = {
|
|||||||
.name = "choose-tree",
|
.name = "choose-tree",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "F:f:GK:NO:rst:wZ", 0, 1 },
|
.args = { "F:f:GK:NO:rst:wZ", 0, 1, NULL },
|
||||||
.usage = "[-GNrswZ] [-F format] [-f filter] [-K key-format] "
|
.usage = "[-GNrswZ] [-F format] [-f filter] [-K key-format] "
|
||||||
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ const struct cmd_entry cmd_choose_client_entry = {
|
|||||||
.name = "choose-client",
|
.name = "choose-client",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "F:f:K:NO:rt:Z", 0, 1 },
|
.args = { "F:f:K:NO:rt:Z", 0, 1, NULL },
|
||||||
.usage = "[-NrZ] [-F format] [-f filter] [-K key-format] "
|
.usage = "[-NrZ] [-F format] [-f filter] [-K key-format] "
|
||||||
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ const struct cmd_entry cmd_choose_buffer_entry = {
|
|||||||
.name = "choose-buffer",
|
.name = "choose-buffer",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "F:f:K:NO:rt:Z", 0, 1 },
|
.args = { "F:f:K:NO:rt:Z", 0, 1, NULL },
|
||||||
.usage = "[-NrZ] [-F format] [-f filter] [-K key-format] "
|
.usage = "[-NrZ] [-F format] [-f filter] [-K key-format] "
|
||||||
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
"[-O sort-order] " CMD_TARGET_PANE_USAGE " [template]",
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ const struct cmd_entry cmd_customize_mode_entry = {
|
|||||||
.name = "customize-mode",
|
.name = "customize-mode",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "F:f:Nt:Z", 0, 0 },
|
.args = { "F:f:Nt:Z", 0, 0, NULL },
|
||||||
.usage = "[-NZ] [-F format] [-f filter] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-NZ] [-F format] [-f filter] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -40,7 +40,7 @@ const struct cmd_entry cmd_command_prompt_entry = {
|
|||||||
.name = "command-prompt",
|
.name = "command-prompt",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "1bFkiI:Np:t:T:", 0, 1 },
|
.args = { "1bFkiI:Np:t:T:", 0, 1, NULL },
|
||||||
.usage = "[-1bFkiN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE
|
.usage = "[-1bFkiN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE
|
||||||
" [-T type] [template]",
|
" [-T type] [template]",
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_confirm_before_entry = {
|
|||||||
.name = "confirm-before",
|
.name = "confirm-before",
|
||||||
.alias = "confirm",
|
.alias = "confirm",
|
||||||
|
|
||||||
.args = { "bp:t:", 1, 1 },
|
.args = { "bp:t:", 1, 1, NULL },
|
||||||
.usage = "[-b] [-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
|
.usage = "[-b] [-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
|
||||||
|
|
||||||
.flags = CMD_CLIENT_TFLAG,
|
.flags = CMD_CLIENT_TFLAG,
|
||||||
|
@ -30,7 +30,7 @@ const struct cmd_entry cmd_copy_mode_entry = {
|
|||||||
.name = "copy-mode",
|
.name = "copy-mode",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "eHMs:t:uq", 0, 0 },
|
.args = { "eHMs:t:uq", 0, 0, NULL },
|
||||||
.usage = "[-eHMuq] [-s src-pane] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-eHMuq] [-s src-pane] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_PANE, 0 },
|
.source = { 's', CMD_FIND_PANE, 0 },
|
||||||
@ -44,7 +44,7 @@ const struct cmd_entry cmd_clock_mode_entry = {
|
|||||||
.name = "clock-mode",
|
.name = "clock-mode",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_PANE_USAGE,
|
.usage = CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_detach_client_entry = {
|
|||||||
.name = "detach-client",
|
.name = "detach-client",
|
||||||
.alias = "detach",
|
.alias = "detach",
|
||||||
|
|
||||||
.args = { "aE:s:t:P", 0, 0 },
|
.args = { "aE:s:t:P", 0, 0, NULL },
|
||||||
.usage = "[-aP] [-E shell-command] "
|
.usage = "[-aP] [-E shell-command] "
|
||||||
"[-s target-session] " CMD_TARGET_CLIENT_USAGE,
|
"[-s target-session] " CMD_TARGET_CLIENT_USAGE,
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ const struct cmd_entry cmd_suspend_client_entry = {
|
|||||||
.name = "suspend-client",
|
.name = "suspend-client",
|
||||||
.alias = "suspendc",
|
.alias = "suspendc",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_CLIENT_USAGE,
|
.usage = CMD_TARGET_CLIENT_USAGE,
|
||||||
|
|
||||||
.flags = CMD_CLIENT_TFLAG,
|
.flags = CMD_CLIENT_TFLAG,
|
||||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_display_menu_entry = {
|
|||||||
.name = "display-menu",
|
.name = "display-menu",
|
||||||
.alias = "menu",
|
.alias = "menu",
|
||||||
|
|
||||||
.args = { "c:t:OT:x:y:", 1, -1 },
|
.args = { "c:t:OT:x:y:", 1, -1, NULL },
|
||||||
.usage = "[-O] [-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] "
|
.usage = "[-O] [-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] "
|
||||||
"[-x position] [-y position] name key command ...",
|
"[-x position] [-y position] name key command ...",
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_display_popup_entry = {
|
|||||||
.name = "display-popup",
|
.name = "display-popup",
|
||||||
.alias = "popup",
|
.alias = "popup",
|
||||||
|
|
||||||
.args = { "BCc:d:Eh:t:w:x:y:", 0, -1 },
|
.args = { "BCc:d:Eh:t:w:x:y:", 0, -1, NULL },
|
||||||
.usage = "[-BCE] [-c target-client] [-d start-directory] [-h height] "
|
.usage = "[-BCE] [-c target-client] [-d start-directory] [-h height] "
|
||||||
CMD_TARGET_PANE_USAGE " [-w width] "
|
CMD_TARGET_PANE_USAGE " [-w width] "
|
||||||
"[-x position] [-y position] [command]",
|
"[-x position] [-y position] [command]",
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_display_message_entry = {
|
|||||||
.name = "display-message",
|
.name = "display-message",
|
||||||
.alias = "display",
|
.alias = "display",
|
||||||
|
|
||||||
.args = { "ac:d:INpt:F:v", 0, 1 },
|
.args = { "ac:d:INpt:F:v", 0, 1, NULL },
|
||||||
.usage = "[-aINpv] [-c target-client] [-d delay] [-F format] "
|
.usage = "[-aINpv] [-c target-client] [-d delay] [-F format] "
|
||||||
CMD_TARGET_PANE_USAGE " [message]",
|
CMD_TARGET_PANE_USAGE " [message]",
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_display_panes_entry = {
|
|||||||
.name = "display-panes",
|
.name = "display-panes",
|
||||||
.alias = "displayp",
|
.alias = "displayp",
|
||||||
|
|
||||||
.args = { "bd:Nt:", 0, 1 },
|
.args = { "bd:Nt:", 0, 1, NULL },
|
||||||
.usage = "[-bN] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
|
.usage = "[-bN] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_find_window_entry = {
|
|||||||
.name = "find-window",
|
.name = "find-window",
|
||||||
.alias = "findw",
|
.alias = "findw",
|
||||||
|
|
||||||
.args = { "CiNrt:TZ", 1, 1 },
|
.args = { "CiNrt:TZ", 1, 1, NULL },
|
||||||
.usage = "[-CiNrTZ] " CMD_TARGET_PANE_USAGE " match-string",
|
.usage = "[-CiNrTZ] " CMD_TARGET_PANE_USAGE " match-string",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_if_shell_entry = {
|
|||||||
.name = "if-shell",
|
.name = "if-shell",
|
||||||
.alias = "if",
|
.alias = "if",
|
||||||
|
|
||||||
.args = { "bFt:", 2, 3 },
|
.args = { "bFt:", 2, 3, NULL },
|
||||||
.usage = "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command "
|
.usage = "[-bF] " CMD_TARGET_PANE_USAGE " shell-command command "
|
||||||
"[command]",
|
"[command]",
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_join_pane_entry = {
|
|||||||
.name = "join-pane",
|
.name = "join-pane",
|
||||||
.alias = "joinp",
|
.alias = "joinp",
|
||||||
|
|
||||||
.args = { "bdfhvp:l:s:t:", 0, 0 },
|
.args = { "bdfhvp:l:s:t:", 0, 0, NULL },
|
||||||
.usage = "[-bdfhv] [-l size] " CMD_SRCDST_PANE_USAGE,
|
.usage = "[-bdfhv] [-l size] " CMD_SRCDST_PANE_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
||||||
@ -49,7 +49,7 @@ const struct cmd_entry cmd_move_pane_entry = {
|
|||||||
.name = "move-pane",
|
.name = "move-pane",
|
||||||
.alias = "movep",
|
.alias = "movep",
|
||||||
|
|
||||||
.args = { "bdfhvp:l:s:t:", 0, 0 },
|
.args = { "bdfhvp:l:s:t:", 0, 0, NULL },
|
||||||
.usage = "[-bdfhv] [-l size] " CMD_SRCDST_PANE_USAGE,
|
.usage = "[-bdfhv] [-l size] " CMD_SRCDST_PANE_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_kill_pane_entry = {
|
|||||||
.name = "kill-pane",
|
.name = "kill-pane",
|
||||||
.alias = "killp",
|
.alias = "killp",
|
||||||
|
|
||||||
.args = { "at:", 0, 0 },
|
.args = { "at:", 0, 0, NULL },
|
||||||
.usage = "[-a] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-a] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_kill_server_entry = {
|
|||||||
.name = "kill-server",
|
.name = "kill-server",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "", 0, 0 },
|
.args = { "", 0, 0, NULL },
|
||||||
.usage = "",
|
.usage = "",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
@ -44,7 +44,7 @@ const struct cmd_entry cmd_start_server_entry = {
|
|||||||
.name = "start-server",
|
.name = "start-server",
|
||||||
.alias = "start",
|
.alias = "start",
|
||||||
|
|
||||||
.args = { "", 0, 0 },
|
.args = { "", 0, 0, NULL },
|
||||||
.usage = "",
|
.usage = "",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER,
|
.flags = CMD_STARTSERVER,
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_kill_session_entry = {
|
|||||||
.name = "kill-session",
|
.name = "kill-session",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "aCt:", 0, 0 },
|
.args = { "aCt:", 0, 0, NULL },
|
||||||
.usage = "[-aC] " CMD_TARGET_SESSION_USAGE,
|
.usage = "[-aC] " CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
|
@ -30,7 +30,7 @@ const struct cmd_entry cmd_kill_window_entry = {
|
|||||||
.name = "kill-window",
|
.name = "kill-window",
|
||||||
.alias = "killw",
|
.alias = "killw",
|
||||||
|
|
||||||
.args = { "at:", 0, 0 },
|
.args = { "at:", 0, 0, NULL },
|
||||||
.usage = "[-a] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-a] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
@ -43,7 +43,7 @@ const struct cmd_entry cmd_unlink_window_entry = {
|
|||||||
.name = "unlink-window",
|
.name = "unlink-window",
|
||||||
.alias = "unlinkw",
|
.alias = "unlinkw",
|
||||||
|
|
||||||
.args = { "kt:", 0, 0 },
|
.args = { "kt:", 0, 0, NULL },
|
||||||
.usage = "[-k] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-k] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_list_buffers_entry = {
|
|||||||
.name = "list-buffers",
|
.name = "list-buffers",
|
||||||
.alias = "lsb",
|
.alias = "lsb",
|
||||||
|
|
||||||
.args = { "F:f:", 0, 0 },
|
.args = { "F:f:", 0, 0, NULL },
|
||||||
.usage = "[-F format] [-f filter]",
|
.usage = "[-F format] [-f filter]",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_list_clients_entry = {
|
|||||||
.name = "list-clients",
|
.name = "list-clients",
|
||||||
.alias = "lsc",
|
.alias = "lsc",
|
||||||
|
|
||||||
.args = { "F:t:", 0, 0 },
|
.args = { "F:t:", 0, 0, NULL },
|
||||||
.usage = "[-F format] " CMD_TARGET_SESSION_USAGE,
|
.usage = "[-F format] " CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_list_keys_entry = {
|
|||||||
.name = "list-keys",
|
.name = "list-keys",
|
||||||
.alias = "lsk",
|
.alias = "lsk",
|
||||||
|
|
||||||
.args = { "1aNP:T:", 0, 1 },
|
.args = { "1aNP:T:", 0, 1, NULL },
|
||||||
.usage = "[-1aN] [-P prefix-string] [-T key-table] [key]",
|
.usage = "[-1aN] [-P prefix-string] [-T key-table] [key]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
@ -47,7 +47,7 @@ const struct cmd_entry cmd_list_commands_entry = {
|
|||||||
.name = "list-commands",
|
.name = "list-commands",
|
||||||
.alias = "lscm",
|
.alias = "lscm",
|
||||||
|
|
||||||
.args = { "F:", 0, 1 },
|
.args = { "F:", 0, 1, NULL },
|
||||||
.usage = "[-F format] [command]",
|
.usage = "[-F format] [command]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_list_panes_entry = {
|
|||||||
.name = "list-panes",
|
.name = "list-panes",
|
||||||
.alias = "lsp",
|
.alias = "lsp",
|
||||||
|
|
||||||
.args = { "asF:f:t:", 0, 0 },
|
.args = { "asF:f:t:", 0, 0, NULL },
|
||||||
.usage = "[-as] [-F format] [-f filter] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-as] [-F format] [-f filter] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -42,7 +42,7 @@ const struct cmd_entry cmd_list_sessions_entry = {
|
|||||||
.name = "list-sessions",
|
.name = "list-sessions",
|
||||||
.alias = "ls",
|
.alias = "ls",
|
||||||
|
|
||||||
.args = { "F:f:", 0, 0 },
|
.args = { "F:f:", 0, 0, NULL },
|
||||||
.usage = "[-F format] [-f filter]",
|
.usage = "[-F format] [-f filter]",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -49,7 +49,7 @@ const struct cmd_entry cmd_list_windows_entry = {
|
|||||||
.name = "list-windows",
|
.name = "list-windows",
|
||||||
.alias = "lsw",
|
.alias = "lsw",
|
||||||
|
|
||||||
.args = { "F:f:at:", 0, 0 },
|
.args = { "F:f:at:", 0, 0, NULL },
|
||||||
.usage = "[-a] [-F format] [-f filter] " CMD_TARGET_SESSION_USAGE,
|
.usage = "[-a] [-F format] [-f filter] " CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_load_buffer_entry = {
|
|||||||
.name = "load-buffer",
|
.name = "load-buffer",
|
||||||
.alias = "loadb",
|
.alias = "loadb",
|
||||||
|
|
||||||
.args = { "b:t:w", 1, 1 },
|
.args = { "b:t:w", 1, 1, NULL },
|
||||||
.usage = CMD_BUFFER_USAGE " " CMD_TARGET_CLIENT_USAGE " path",
|
.usage = CMD_BUFFER_USAGE " " CMD_TARGET_CLIENT_USAGE " path",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG|CMD_CLIENT_CANFAIL,
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG|CMD_CLIENT_CANFAIL,
|
||||||
|
@ -30,7 +30,7 @@ const struct cmd_entry cmd_lock_server_entry = {
|
|||||||
.name = "lock-server",
|
.name = "lock-server",
|
||||||
.alias = "lock",
|
.alias = "lock",
|
||||||
|
|
||||||
.args = { "", 0, 0 },
|
.args = { "", 0, 0, NULL },
|
||||||
.usage = "",
|
.usage = "",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
@ -41,7 +41,7 @@ const struct cmd_entry cmd_lock_session_entry = {
|
|||||||
.name = "lock-session",
|
.name = "lock-session",
|
||||||
.alias = "locks",
|
.alias = "locks",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_SESSION_USAGE,
|
.usage = CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
@ -54,7 +54,7 @@ const struct cmd_entry cmd_lock_client_entry = {
|
|||||||
.name = "lock-client",
|
.name = "lock-client",
|
||||||
.alias = "lockc",
|
.alias = "lockc",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_CLIENT_USAGE,
|
.usage = CMD_TARGET_CLIENT_USAGE,
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_move_window_entry = {
|
|||||||
.name = "move-window",
|
.name = "move-window",
|
||||||
.alias = "movew",
|
.alias = "movew",
|
||||||
|
|
||||||
.args = { "abdkrs:t:", 0, 0 },
|
.args = { "abdkrs:t:", 0, 0, NULL },
|
||||||
.usage = "[-abdkr] " CMD_SRCDST_WINDOW_USAGE,
|
.usage = "[-abdkr] " CMD_SRCDST_WINDOW_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_WINDOW, 0 },
|
.source = { 's', CMD_FIND_WINDOW, 0 },
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_link_window_entry = {
|
|||||||
.name = "link-window",
|
.name = "link-window",
|
||||||
.alias = "linkw",
|
.alias = "linkw",
|
||||||
|
|
||||||
.args = { "abdks:t:", 0, 0 },
|
.args = { "abdks:t:", 0, 0, NULL },
|
||||||
.usage = "[-abdk] " CMD_SRCDST_WINDOW_USAGE,
|
.usage = "[-abdk] " CMD_SRCDST_WINDOW_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_WINDOW, 0 },
|
.source = { 's', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_new_session_entry = {
|
|||||||
.name = "new-session",
|
.name = "new-session",
|
||||||
.alias = "new",
|
.alias = "new",
|
||||||
|
|
||||||
.args = { "Ac:dDe:EF:f:n:Ps:t:x:Xy:", 0, -1 },
|
.args = { "Ac:dDe:EF:f:n:Ps:t:x:Xy:", 0, -1, NULL },
|
||||||
.usage = "[-AdDEPX] [-c start-directory] [-e environment] [-F format] "
|
.usage = "[-AdDEPX] [-c start-directory] [-e environment] [-F format] "
|
||||||
"[-f flags] [-n window-name] [-s session-name] "
|
"[-f flags] [-n window-name] [-s session-name] "
|
||||||
CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]",
|
CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]",
|
||||||
@ -54,7 +54,7 @@ const struct cmd_entry cmd_has_session_entry = {
|
|||||||
.name = "has-session",
|
.name = "has-session",
|
||||||
.alias = "has",
|
.alias = "has",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_SESSION_USAGE,
|
.usage = CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
@ -271,7 +271,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
environ_update(global_s_options, c->environ, env);
|
environ_update(global_s_options, c->environ, env);
|
||||||
av = args_first_value(args, 'e');
|
av = args_first_value(args, 'e');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
environ_put(env, av->value, 0);
|
environ_put(env, av->string, 0);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
s = session_create(prefix, newname, cwd, env, oo, tiop);
|
s = session_create(prefix, newname, cwd, env, oo, tiop);
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_new_window_entry = {
|
|||||||
.name = "new-window",
|
.name = "new-window",
|
||||||
.alias = "neww",
|
.alias = "neww",
|
||||||
|
|
||||||
.args = { "abc:de:F:kn:PSt:", 0, -1 },
|
.args = { "abc:de:F:kn:PSt:", 0, -1, NULL },
|
||||||
.usage = "[-abdkPS] [-c start-directory] [-e environment] [-F format] "
|
.usage = "[-abdkPS] [-c start-directory] [-e environment] [-F format] "
|
||||||
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]",
|
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]",
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
av = args_first_value(args, 'e');
|
av = args_first_value(args, 'e');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
environ_put(sc.environ, av->value, 0);
|
environ_put(sc.environ, av->string, 0);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_paste_buffer_entry = {
|
|||||||
.name = "paste-buffer",
|
.name = "paste-buffer",
|
||||||
.alias = "pasteb",
|
.alias = "pasteb",
|
||||||
|
|
||||||
.args = { "db:prs:t:", 0, 0 },
|
.args = { "db:prs:t:", 0, 0, NULL },
|
||||||
.usage = "[-dpr] [-s separator] " CMD_BUFFER_USAGE " "
|
.usage = "[-dpr] [-s separator] " CMD_BUFFER_USAGE " "
|
||||||
CMD_TARGET_PANE_USAGE,
|
CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ const struct cmd_entry cmd_pipe_pane_entry = {
|
|||||||
.name = "pipe-pane",
|
.name = "pipe-pane",
|
||||||
.alias = "pipep",
|
.alias = "pipep",
|
||||||
|
|
||||||
.args = { "IOot:", 0, 1 },
|
.args = { "IOot:", 0, 1, NULL },
|
||||||
.usage = "[-IOo] " CMD_TARGET_PANE_USAGE " [shell-command]",
|
.usage = "[-IOo] " CMD_TARGET_PANE_USAGE " [shell-command]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -413,7 +413,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item,
|
|||||||
av = args_first_value(args, flag);
|
av = args_first_value(args, flag);
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
xsnprintf(tmp, sizeof tmp, "hook_flag_%c_%d", flag, i);
|
xsnprintf(tmp, sizeof tmp, "hook_flag_%c_%d", flag, i);
|
||||||
cmdq_add_format(new_state, tmp, "%s", av->value);
|
cmdq_add_format(new_state, tmp, "%s", av->string);
|
||||||
i++;
|
i++;
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_refresh_client_entry = {
|
|||||||
.name = "refresh-client",
|
.name = "refresh-client",
|
||||||
.alias = "refresh",
|
.alias = "refresh",
|
||||||
|
|
||||||
.args = { "A:B:cC:Df:F:lLRSt:U", 0, 1 },
|
.args = { "A:B:cC:Df:F:lLRSt:U", 0, 1, NULL },
|
||||||
.usage = "[-cDlLRSU] [-A pane:state] [-B name:what:format] "
|
.usage = "[-cDlLRSU] [-A pane:state] [-B name:what:format] "
|
||||||
"[-C XxY] [-f flags] " CMD_TARGET_CLIENT_USAGE " [adjustment]",
|
"[-C XxY] [-f flags] " CMD_TARGET_CLIENT_USAGE " [adjustment]",
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
goto not_control_client;
|
goto not_control_client;
|
||||||
av = args_first_value(args, 'A');
|
av = args_first_value(args, 'A');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
cmd_refresh_client_update_offset(tc, av->value);
|
cmd_refresh_client_update_offset(tc, av->string);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
@ -197,7 +197,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
goto not_control_client;
|
goto not_control_client;
|
||||||
av = args_first_value(args, 'B');
|
av = args_first_value(args, 'B');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
cmd_refresh_client_update_subscription(tc, av->value);
|
cmd_refresh_client_update_subscription(tc, av->string);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_rename_session_entry = {
|
|||||||
.name = "rename-session",
|
.name = "rename-session",
|
||||||
.alias = "rename",
|
.alias = "rename",
|
||||||
|
|
||||||
.args = { "t:", 1, 1 },
|
.args = { "t:", 1, 1, NULL },
|
||||||
.usage = CMD_TARGET_SESSION_USAGE " new-name",
|
.usage = CMD_TARGET_SESSION_USAGE " new-name",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_rename_window_entry = {
|
|||||||
.name = "rename-window",
|
.name = "rename-window",
|
||||||
.alias = "renamew",
|
.alias = "renamew",
|
||||||
|
|
||||||
.args = { "t:", 1, 1 },
|
.args = { "t:", 1, 1, NULL },
|
||||||
.usage = CMD_TARGET_WINDOW_USAGE " new-name",
|
.usage = CMD_TARGET_WINDOW_USAGE " new-name",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_resize_pane_entry = {
|
|||||||
.name = "resize-pane",
|
.name = "resize-pane",
|
||||||
.alias = "resizep",
|
.alias = "resizep",
|
||||||
|
|
||||||
.args = { "DLMRTt:Ux:y:Z", 0, 1 },
|
.args = { "DLMRTt:Ux:y:Z", 0, 1, NULL },
|
||||||
.usage = "[-DLMRTUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " "
|
.usage = "[-DLMRTUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " "
|
||||||
"[adjustment]",
|
"[adjustment]",
|
||||||
|
|
||||||
@ -98,8 +98,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (args_count(args) == 0)
|
if (args_count(args) == 0)
|
||||||
adjust = 1;
|
adjust = 1;
|
||||||
else {
|
else {
|
||||||
adjust = strtonum(args_string(args, 0), 1, INT_MAX,
|
adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr);
|
||||||
&errstr);
|
|
||||||
if (errstr != NULL) {
|
if (errstr != NULL) {
|
||||||
cmdq_error(item, "adjustment %s", errstr);
|
cmdq_error(item, "adjustment %s", errstr);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_resize_window_entry = {
|
|||||||
.name = "resize-window",
|
.name = "resize-window",
|
||||||
.alias = "resizew",
|
.alias = "resizew",
|
||||||
|
|
||||||
.args = { "aADLRt:Ux:y:", 0, 1 },
|
.args = { "aADLRt:Ux:y:", 0, 1, NULL },
|
||||||
.usage = "[-aADLRU] [-x width] [-y height] " CMD_TARGET_WINDOW_USAGE " "
|
.usage = "[-aADLRU] [-x width] [-y height] " CMD_TARGET_WINDOW_USAGE " "
|
||||||
"[adjustment]",
|
"[adjustment]",
|
||||||
|
|
||||||
@ -59,8 +59,7 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (args_count(args) == 0)
|
if (args_count(args) == 0)
|
||||||
adjust = 1;
|
adjust = 1;
|
||||||
else {
|
else {
|
||||||
adjust = strtonum(args_string(args, 0), 1, INT_MAX,
|
adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr);
|
||||||
&errstr);
|
|
||||||
if (errstr != NULL) {
|
if (errstr != NULL) {
|
||||||
cmdq_error(item, "adjustment %s", errstr);
|
cmdq_error(item, "adjustment %s", errstr);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_respawn_pane_entry = {
|
|||||||
.name = "respawn-pane",
|
.name = "respawn-pane",
|
||||||
.alias = "respawnp",
|
.alias = "respawnp",
|
||||||
|
|
||||||
.args = { "c:e:kt:", 0, -1 },
|
.args = { "c:e:kt:", 0, -1, NULL },
|
||||||
.usage = "[-k] [-c start-directory] [-e environment] "
|
.usage = "[-k] [-c start-directory] [-e environment] "
|
||||||
CMD_TARGET_PANE_USAGE " [command]",
|
CMD_TARGET_PANE_USAGE " [command]",
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
av = args_first_value(args, 'e');
|
av = args_first_value(args, 'e');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
environ_put(sc.environ, av->value, 0);
|
environ_put(sc.environ, av->string, 0);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_respawn_window_entry = {
|
|||||||
.name = "respawn-window",
|
.name = "respawn-window",
|
||||||
.alias = "respawnw",
|
.alias = "respawnw",
|
||||||
|
|
||||||
.args = { "c:e:kt:", 0, -1 },
|
.args = { "c:e:kt:", 0, -1, NULL },
|
||||||
.usage = "[-k] [-c start-directory] [-e environment] "
|
.usage = "[-k] [-c start-directory] [-e environment] "
|
||||||
CMD_TARGET_WINDOW_USAGE " [command]",
|
CMD_TARGET_WINDOW_USAGE " [command]",
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
av = args_first_value(args, 'e');
|
av = args_first_value(args, 'e');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
environ_put(sc.environ, av->value, 0);
|
environ_put(sc.environ, av->string, 0);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ const struct cmd_entry cmd_rotate_window_entry = {
|
|||||||
.name = "rotate-window",
|
.name = "rotate-window",
|
||||||
.alias = "rotatew",
|
.alias = "rotatew",
|
||||||
|
|
||||||
.args = { "Dt:UZ", 0, 0 },
|
.args = { "Dt:UZ", 0, 0, NULL },
|
||||||
.usage = "[-DUZ] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-DUZ] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_run_shell_entry = {
|
|||||||
.name = "run-shell",
|
.name = "run-shell",
|
||||||
.alias = "run",
|
.alias = "run",
|
||||||
|
|
||||||
.args = { "bd:Ct:", 0, 1 },
|
.args = { "bd:Ct:", 0, 1, NULL },
|
||||||
.usage = "[-bC] [-d delay] " CMD_TARGET_PANE_USAGE " [shell-command]",
|
.usage = "[-bC] [-d delay] " CMD_TARGET_PANE_USAGE " [shell-command]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_save_buffer_entry = {
|
|||||||
.name = "save-buffer",
|
.name = "save-buffer",
|
||||||
.alias = "saveb",
|
.alias = "saveb",
|
||||||
|
|
||||||
.args = { "ab:", 1, 1 },
|
.args = { "ab:", 1, 1, NULL },
|
||||||
.usage = "[-a] " CMD_BUFFER_USAGE " path",
|
.usage = "[-a] " CMD_BUFFER_USAGE " path",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
@ -48,7 +48,7 @@ const struct cmd_entry cmd_show_buffer_entry = {
|
|||||||
.name = "show-buffer",
|
.name = "show-buffer",
|
||||||
.alias = "showb",
|
.alias = "showb",
|
||||||
|
|
||||||
.args = { "b:", 0, 0 },
|
.args = { "b:", 0, 0, NULL },
|
||||||
.usage = CMD_BUFFER_USAGE,
|
.usage = CMD_BUFFER_USAGE,
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_select_layout_entry = {
|
|||||||
.name = "select-layout",
|
.name = "select-layout",
|
||||||
.alias = "selectl",
|
.alias = "selectl",
|
||||||
|
|
||||||
.args = { "Enopt:", 0, 1 },
|
.args = { "Enopt:", 0, 1, NULL },
|
||||||
.usage = "[-Enop] " CMD_TARGET_PANE_USAGE " [layout-name]",
|
.usage = "[-Enop] " CMD_TARGET_PANE_USAGE " [layout-name]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_next_layout_entry = {
|
|||||||
.name = "next-layout",
|
.name = "next-layout",
|
||||||
.alias = "nextl",
|
.alias = "nextl",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_WINDOW_USAGE,
|
.usage = CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
@ -59,7 +59,7 @@ const struct cmd_entry cmd_previous_layout_entry = {
|
|||||||
.name = "previous-layout",
|
.name = "previous-layout",
|
||||||
.alias = "prevl",
|
.alias = "prevl",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_WINDOW_USAGE,
|
.usage = CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_select_pane_entry = {
|
|||||||
.name = "select-pane",
|
.name = "select-pane",
|
||||||
.alias = "selectp",
|
.alias = "selectp",
|
||||||
|
|
||||||
.args = { "DdegLlMmP:RT:t:UZ", 0, 0 }, /* -P and -g deprecated */
|
.args = { "DdegLlMmP:RT:t:UZ", 0, 0, NULL }, /* -P and -g deprecated */
|
||||||
.usage = "[-DdeLlMmRUZ] [-T title] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-DdeLlMmRUZ] [-T title] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_last_pane_entry = {
|
|||||||
.name = "last-pane",
|
.name = "last-pane",
|
||||||
.alias = "lastp",
|
.alias = "lastp",
|
||||||
|
|
||||||
.args = { "det:Z", 0, 0 },
|
.args = { "det:Z", 0, 0, NULL },
|
||||||
.usage = "[-deZ] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-deZ] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_select_window_entry = {
|
|||||||
.name = "select-window",
|
.name = "select-window",
|
||||||
.alias = "selectw",
|
.alias = "selectw",
|
||||||
|
|
||||||
.args = { "lnpTt:", 0, 0 },
|
.args = { "lnpTt:", 0, 0, NULL },
|
||||||
.usage = "[-lnpT] " CMD_TARGET_WINDOW_USAGE,
|
.usage = "[-lnpT] " CMD_TARGET_WINDOW_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, 0 },
|
.target = { 't', CMD_FIND_WINDOW, 0 },
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_next_window_entry = {
|
|||||||
.name = "next-window",
|
.name = "next-window",
|
||||||
.alias = "next",
|
.alias = "next",
|
||||||
|
|
||||||
.args = { "at:", 0, 0 },
|
.args = { "at:", 0, 0, NULL },
|
||||||
.usage = "[-a] " CMD_TARGET_SESSION_USAGE,
|
.usage = "[-a] " CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
@ -59,7 +59,7 @@ const struct cmd_entry cmd_previous_window_entry = {
|
|||||||
.name = "previous-window",
|
.name = "previous-window",
|
||||||
.alias = "prev",
|
.alias = "prev",
|
||||||
|
|
||||||
.args = { "at:", 0, 0 },
|
.args = { "at:", 0, 0, NULL },
|
||||||
.usage = "[-a] " CMD_TARGET_SESSION_USAGE,
|
.usage = "[-a] " CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
@ -72,7 +72,7 @@ const struct cmd_entry cmd_last_window_entry = {
|
|||||||
.name = "last-window",
|
.name = "last-window",
|
||||||
.alias = "last",
|
.alias = "last",
|
||||||
|
|
||||||
.args = { "t:", 0, 0 },
|
.args = { "t:", 0, 0, NULL },
|
||||||
.usage = CMD_TARGET_SESSION_USAGE,
|
.usage = CMD_TARGET_SESSION_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, 0 },
|
.target = { 't', CMD_FIND_SESSION, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_send_keys_entry = {
|
|||||||
.name = "send-keys",
|
.name = "send-keys",
|
||||||
.alias = "send",
|
.alias = "send",
|
||||||
|
|
||||||
.args = { "FHlMN:Rt:X", 0, -1 },
|
.args = { "FHlMN:Rt:X", 0, -1, NULL },
|
||||||
.usage = "[-FHlMRX] [-N repeat-count] " CMD_TARGET_PANE_USAGE
|
.usage = "[-FHlMRX] [-N repeat-count] " CMD_TARGET_PANE_USAGE
|
||||||
" key ...",
|
" key ...",
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ const struct cmd_entry cmd_send_prefix_entry = {
|
|||||||
.name = "send-prefix",
|
.name = "send-prefix",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "2t:", 0, 0 },
|
.args = { "2t:", 0, 0, NULL },
|
||||||
.usage = "[-2] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-2] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_set_buffer_entry = {
|
|||||||
.name = "set-buffer",
|
.name = "set-buffer",
|
||||||
.alias = "setb",
|
.alias = "setb",
|
||||||
|
|
||||||
.args = { "ab:t:n:w", 0, 1 },
|
.args = { "ab:t:n:w", 0, 1, NULL },
|
||||||
.usage = "[-aw] " CMD_BUFFER_USAGE " [-n new-buffer-name] "
|
.usage = "[-aw] " CMD_BUFFER_USAGE " [-n new-buffer-name] "
|
||||||
CMD_TARGET_CLIENT_USAGE " data",
|
CMD_TARGET_CLIENT_USAGE " data",
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ const struct cmd_entry cmd_delete_buffer_entry = {
|
|||||||
.name = "delete-buffer",
|
.name = "delete-buffer",
|
||||||
.alias = "deleteb",
|
.alias = "deleteb",
|
||||||
|
|
||||||
.args = { "b:", 0, 0 },
|
.args = { "b:", 0, 0, NULL },
|
||||||
.usage = CMD_BUFFER_USAGE,
|
.usage = CMD_BUFFER_USAGE,
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_set_environment_entry = {
|
|||||||
.name = "set-environment",
|
.name = "set-environment",
|
||||||
.alias = "setenv",
|
.alias = "setenv",
|
||||||
|
|
||||||
.args = { "Fhgrt:u", 1, 2 },
|
.args = { "Fhgrt:u", 1, 2, NULL },
|
||||||
.usage = "[-Fhgru] " CMD_TARGET_SESSION_USAGE " name [value]",
|
.usage = "[-Fhgru] " CMD_TARGET_SESSION_USAGE " name [value]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL },
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_set_option_entry = {
|
|||||||
.name = "set-option",
|
.name = "set-option",
|
||||||
.alias = "set",
|
.alias = "set",
|
||||||
|
|
||||||
.args = { "aFgopqst:uUw", 1, 2 },
|
.args = { "aFgopqst:uUw", 1, 2, NULL },
|
||||||
.usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]",
|
.usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_set_window_option_entry = {
|
|||||||
.name = "set-window-option",
|
.name = "set-window-option",
|
||||||
.alias = "setw",
|
.alias = "setw",
|
||||||
|
|
||||||
.args = { "aFgoqt:u", 1, 2 },
|
.args = { "aFgoqt:u", 1, 2, NULL },
|
||||||
.usage = "[-aFgoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
|
.usage = "[-aFgoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL },
|
||||||
@ -59,7 +59,7 @@ const struct cmd_entry cmd_set_hook_entry = {
|
|||||||
.name = "set-hook",
|
.name = "set-hook",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "agpRt:uw", 1, 2 },
|
.args = { "agpRt:uw", 1, 2, NULL },
|
||||||
.usage = "[-agpRuw] " CMD_TARGET_PANE_USAGE " hook [command]",
|
.usage = "[-agpRuw] " CMD_TARGET_PANE_USAGE " hook [command]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_show_environment_entry = {
|
|||||||
.name = "show-environment",
|
.name = "show-environment",
|
||||||
.alias = "showenv",
|
.alias = "showenv",
|
||||||
|
|
||||||
.args = { "hgst:", 0, 1 },
|
.args = { "hgst:", 0, 1, NULL },
|
||||||
.usage = "[-hgs] " CMD_TARGET_SESSION_USAGE " [name]",
|
.usage = "[-hgs] " CMD_TARGET_SESSION_USAGE " [name]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL },
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_show_messages_entry = {
|
|||||||
.name = "show-messages",
|
.name = "show-messages",
|
||||||
.alias = "showmsgs",
|
.alias = "showmsgs",
|
||||||
|
|
||||||
.args = { "JTt:", 0, 0 },
|
.args = { "JTt:", 0, 0, NULL },
|
||||||
.usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
|
.usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_show_options_entry = {
|
|||||||
.name = "show-options",
|
.name = "show-options",
|
||||||
.alias = "show",
|
.alias = "show",
|
||||||
|
|
||||||
.args = { "AgHpqst:vw", 0, 1 },
|
.args = { "AgHpqst:vw", 0, 1, NULL },
|
||||||
.usage = "[-AgHpqsvw] " CMD_TARGET_PANE_USAGE " [option]",
|
.usage = "[-AgHpqsvw] " CMD_TARGET_PANE_USAGE " [option]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
||||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_show_window_options_entry = {
|
|||||||
.name = "show-window-options",
|
.name = "show-window-options",
|
||||||
.alias = "showw",
|
.alias = "showw",
|
||||||
|
|
||||||
.args = { "gvt:", 0, 1 },
|
.args = { "gvt:", 0, 1, NULL },
|
||||||
.usage = "[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
|
.usage = "[-gv] " CMD_TARGET_WINDOW_USAGE " [option]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL },
|
||||||
@ -64,7 +64,7 @@ const struct cmd_entry cmd_show_hooks_entry = {
|
|||||||
.name = "show-hooks",
|
.name = "show-hooks",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "gpt:w", 0, 1 },
|
.args = { "gpt:w", 0, 1, NULL },
|
||||||
.usage = "[-gpw] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-gpw] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
|
||||||
|
@ -31,7 +31,7 @@ const struct cmd_entry cmd_show_prompt_history_entry = {
|
|||||||
.name = "show-prompt-history",
|
.name = "show-prompt-history",
|
||||||
.alias = "showphist",
|
.alias = "showphist",
|
||||||
|
|
||||||
.args = { "T:", 0, 0 },
|
.args = { "T:", 0, 0, NULL },
|
||||||
.usage = "[-T type]",
|
.usage = "[-T type]",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
@ -42,7 +42,7 @@ const struct cmd_entry cmd_clear_prompt_history_entry = {
|
|||||||
.name = "clear-prompt-history",
|
.name = "clear-prompt-history",
|
||||||
.alias = "clearphist",
|
.alias = "clearphist",
|
||||||
|
|
||||||
.args = { "T:", 0, 0 },
|
.args = { "T:", 0, 0, NULL },
|
||||||
.usage = "[-T type]",
|
.usage = "[-T type]",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_source_file_entry = {
|
|||||||
.name = "source-file",
|
.name = "source-file",
|
||||||
.alias = "source",
|
.alias = "source",
|
||||||
|
|
||||||
.args = { "Fnqv", 1, -1 },
|
.args = { "Fnqv", 1, -1, NULL },
|
||||||
.usage = "[-Fnqv] path ...",
|
.usage = "[-Fnqv] path ...",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_split_window_entry = {
|
|||||||
.name = "split-window",
|
.name = "split-window",
|
||||||
.alias = "splitw",
|
.alias = "splitw",
|
||||||
|
|
||||||
.args = { "bc:de:fF:hIl:p:Pt:vZ", 0, -1 },
|
.args = { "bc:de:fF:hIl:p:Pt:vZ", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIPvZ] [-c start-directory] [-e environment] "
|
.usage = "[-bdefhIPvZ] [-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] " CMD_TARGET_PANE_USAGE " [command]",
|
"[-F format] [-l size] " CMD_TARGET_PANE_USAGE " [command]",
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
av = args_first_value(args, 'e');
|
av = args_first_value(args, 'e');
|
||||||
while (av != NULL) {
|
while (av != NULL) {
|
||||||
environ_put(sc.environ, av->value, 0);
|
environ_put(sc.environ, av->string, 0);
|
||||||
av = args_next_value(av);
|
av = args_next_value(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_swap_pane_entry = {
|
|||||||
.name = "swap-pane",
|
.name = "swap-pane",
|
||||||
.alias = "swapp",
|
.alias = "swapp",
|
||||||
|
|
||||||
.args = { "dDs:t:UZ", 0, 0 },
|
.args = { "dDs:t:UZ", 0, 0, NULL },
|
||||||
.usage = "[-dDUZ] " CMD_SRCDST_PANE_USAGE,
|
.usage = "[-dDUZ] " CMD_SRCDST_PANE_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_swap_window_entry = {
|
|||||||
.name = "swap-window",
|
.name = "swap-window",
|
||||||
.alias = "swapw",
|
.alias = "swapw",
|
||||||
|
|
||||||
.args = { "ds:t:", 0, 0 },
|
.args = { "ds:t:", 0, 0, NULL },
|
||||||
.usage = "[-d] " CMD_SRCDST_WINDOW_USAGE,
|
.usage = "[-d] " CMD_SRCDST_WINDOW_USAGE,
|
||||||
|
|
||||||
.source = { 's', CMD_FIND_WINDOW, CMD_FIND_DEFAULT_MARKED },
|
.source = { 's', CMD_FIND_WINDOW, CMD_FIND_DEFAULT_MARKED },
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_switch_client_entry = {
|
|||||||
.name = "switch-client",
|
.name = "switch-client",
|
||||||
.alias = "switchc",
|
.alias = "switchc",
|
||||||
|
|
||||||
.args = { "lc:EFnpt:rT:Z", 0, 0 },
|
.args = { "lc:EFnpt:rT:Z", 0, 0, NULL },
|
||||||
.usage = "[-ElnprZ] [-c target-client] [-t target-session] "
|
.usage = "[-ElnprZ] [-c target-client] [-t target-session] "
|
||||||
"[-T key-table]",
|
"[-T key-table]",
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const struct cmd_entry cmd_unbind_key_entry = {
|
|||||||
.name = "unbind-key",
|
.name = "unbind-key",
|
||||||
.alias = "unbind",
|
.alias = "unbind",
|
||||||
|
|
||||||
.args = { "anqT:", 0, 1 },
|
.args = { "anqT:", 0, 1, NULL },
|
||||||
.usage = "[-anq] [-T key-table] key",
|
.usage = "[-anq] [-T key-table] key",
|
||||||
|
|
||||||
.flags = CMD_AFTERHOOK,
|
.flags = CMD_AFTERHOOK,
|
||||||
|
@ -34,7 +34,7 @@ const struct cmd_entry cmd_wait_for_entry = {
|
|||||||
.name = "wait-for",
|
.name = "wait-for",
|
||||||
.alias = "wait",
|
.alias = "wait",
|
||||||
|
|
||||||
.args = { "LSU", 1, 1 },
|
.args = { "LSU", 1, 1, NULL },
|
||||||
.usage = "[-L|-S|-U] channel",
|
.usage = "[-L|-S|-U] channel",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
|
3
cmd.c
3
cmd.c
@ -517,8 +517,7 @@ cmd_parse(int argc, char **argv, const char *file, u_int line, char **cause)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
cmd_log_argv(argc, argv, "%s: %s", __func__, entry->name);
|
cmd_log_argv(argc, argv, "%s: %s", __func__, entry->name);
|
||||||
|
|
||||||
args = args_parse(entry->args.template, argc, argv, entry->args.lower,
|
args = args_parse(&entry->args, argc, argv);
|
||||||
entry->args.upper);
|
|
||||||
if (args == NULL)
|
if (args == NULL)
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
|
19
tmux.h
19
tmux.h
@ -1358,7 +1358,7 @@ TAILQ_HEAD(message_list, message_entry);
|
|||||||
|
|
||||||
/* Argument value. */
|
/* Argument value. */
|
||||||
struct args_value {
|
struct args_value {
|
||||||
char *value;
|
char *string;
|
||||||
TAILQ_ENTRY(args_value) entry;
|
TAILQ_ENTRY(args_value) entry;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1366,6 +1366,15 @@ struct args_value {
|
|||||||
struct args_entry;
|
struct args_entry;
|
||||||
RB_HEAD(args_tree, args_entry);
|
RB_HEAD(args_tree, args_entry);
|
||||||
|
|
||||||
|
/* Arguments parsing state. */
|
||||||
|
typedef enum args_type (*args_parse_cb)(struct args *, u_int);
|
||||||
|
struct args_parse {
|
||||||
|
const char *template;
|
||||||
|
int lower;
|
||||||
|
int upper;
|
||||||
|
args_parse_cb cb;
|
||||||
|
};
|
||||||
|
|
||||||
/* Command find structures. */
|
/* Command find structures. */
|
||||||
enum cmd_find_type {
|
enum cmd_find_type {
|
||||||
CMD_FIND_PANE,
|
CMD_FIND_PANE,
|
||||||
@ -1454,11 +1463,7 @@ struct cmd_entry {
|
|||||||
const char *name;
|
const char *name;
|
||||||
const char *alias;
|
const char *alias;
|
||||||
|
|
||||||
struct {
|
struct args_parse args;
|
||||||
const char *template;
|
|
||||||
int lower;
|
|
||||||
int upper;
|
|
||||||
} args;
|
|
||||||
const char *usage;
|
const char *usage;
|
||||||
|
|
||||||
struct cmd_entry_flag source;
|
struct cmd_entry_flag source;
|
||||||
@ -2184,7 +2189,7 @@ int tty_keys_next(struct tty *);
|
|||||||
/* arguments.c */
|
/* arguments.c */
|
||||||
void args_set(struct args *, u_char, const char *);
|
void args_set(struct args *, u_char, const char *);
|
||||||
struct args *args_create(void);
|
struct args *args_create(void);
|
||||||
struct args *args_parse(const char *, int, char **, int, int);
|
struct args *args_parse(const struct args_parse *, int, char **);
|
||||||
void args_vector(struct args *, int *, char ***);
|
void args_vector(struct args *, int *, char ***);
|
||||||
void args_free(struct args *);
|
void args_free(struct args *);
|
||||||
char *args_print(struct args *);
|
char *args_print(struct args *);
|
||||||
|
Loading…
Reference in New Issue
Block a user