Sync OpenBSD patchset 829:

Clean up and simplify tmux command argument parsing.

Originally, tmux commands were parsed in the client process into a
struct with the command data which was then serialised and sent to the
server to be executed. The parsing was later moved into the server (an
argv was sent from the client), but the parse step and intermediate
struct was kept.

This change removes that struct and the separate parse step. Argument
parsing and printing is now common to all commands (in arguments.c) with
each command left with just an optional check function (to validate the
arguments at parse time), the exec function and a function to set up any
key bindings (renamed from the old init function).

This is overall more simple and consistent.

There should be no changes to any commands behaviour or syntax although
as this touches every command please watch for any unexpected changes.
This commit is contained in:
Tiago Cunha
2011-01-07 14:45:34 +00:00
parent 219442cff7
commit 1df427bc7b
85 changed files with 1690 additions and 3048 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-list-commands.c,v 1.7 2009-11-28 14:50:36 tcunha Exp $ */
/* $Id: cmd-list-commands.c,v 1.8 2011-01-07 14:45:34 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -28,13 +28,12 @@ int cmd_list_commands_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_list_commands_entry = {
"list-commands", "lscm",
"", 0, 0,
"",
0, "",
0,
NULL,
NULL,
cmd_list_commands_exec,
NULL,
NULL
cmd_list_commands_exec
};
/* ARGSUSED */