mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-18 09:30:04 +02:00
Move -s and -c down a level so handling them is the responsibility of the command (with some helper functions), rather than the top-level. This changes the action command syntax so that -s and -c must be after the command rather than before.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-set-option.c,v 1.15 2007-12-06 09:46:22 nicm Exp $ */
|
||||
/* $Id: cmd-set-option.c,v 1.16 2008-06-02 18:08:16 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -28,7 +28,7 @@
|
||||
* Set an option.
|
||||
*/
|
||||
|
||||
int cmd_set_option_parse(void **, int, char **, char **);
|
||||
int cmd_set_option_parse(struct cmd *, void **, int, char **, char **);
|
||||
void cmd_set_option_exec(void *, struct cmd_ctx *);
|
||||
void cmd_set_option_send(void *, struct buffer *);
|
||||
void cmd_set_option_recv(void **, struct buffer *);
|
||||
@@ -40,8 +40,9 @@ struct cmd_set_option_data {
|
||||
};
|
||||
|
||||
const struct cmd_entry cmd_set_option_entry = {
|
||||
"set-option", "set", "option value",
|
||||
CMD_NOCLIENT|CMD_NOSESSION,
|
||||
"set-option", "set",
|
||||
"option value",
|
||||
0,
|
||||
cmd_set_option_parse,
|
||||
cmd_set_option_exec,
|
||||
cmd_set_option_send,
|
||||
@@ -50,7 +51,8 @@ const struct cmd_entry cmd_set_option_entry = {
|
||||
};
|
||||
|
||||
int
|
||||
cmd_set_option_parse(void **ptr, int argc, char **argv, char **cause)
|
||||
cmd_set_option_parse(
|
||||
struct cmd *self, void **ptr, int argc, char **argv, char **cause)
|
||||
{
|
||||
struct cmd_set_option_data *data;
|
||||
int opt;
|
||||
@@ -77,8 +79,7 @@ cmd_set_option_parse(void **ptr, int argc, char **argv, char **cause)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
usage(cause, "%s %s",
|
||||
cmd_set_option_entry.name, cmd_set_option_entry.usage);
|
||||
usage(cause, "%s %s", self->entry->name, self->entry->usage);
|
||||
|
||||
cmd_set_option_free(data);
|
||||
return (-1);
|
||||
|
Reference in New Issue
Block a user