mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Make shell_command a global like other stuff rather than making it an
exception and using callback argument.
This commit is contained in:
12
tmux.c
12
tmux.c
@ -44,6 +44,7 @@ struct hooks *global_hooks;
|
||||
struct timeval start_time;
|
||||
const char *socket_path;
|
||||
int ptm_fd = -1;
|
||||
const char *shell_command;
|
||||
|
||||
static __dead void usage(void);
|
||||
static char *make_label(const char *);
|
||||
@ -190,8 +191,8 @@ find_home(void)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *path, *label, tmp[PATH_MAX];
|
||||
char *shellcmd = NULL, **var;
|
||||
char *path, *label, **var;
|
||||
char tmp[PATH_MAX];
|
||||
const char *s, *shell;
|
||||
int opt, flags, keys;
|
||||
const struct options_table_entry *oe;
|
||||
@ -220,8 +221,7 @@ main(int argc, char **argv)
|
||||
flags |= CLIENT_256COLOURS;
|
||||
break;
|
||||
case 'c':
|
||||
free(shellcmd);
|
||||
shellcmd = xstrdup(optarg);
|
||||
shell_command = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
if (flags & CLIENT_CONTROL)
|
||||
@ -258,7 +258,7 @@ main(int argc, char **argv)
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (shellcmd != NULL && argc != 0)
|
||||
if (shell_command != NULL && argc != 0)
|
||||
usage();
|
||||
|
||||
if ((ptm_fd = getptmfd()) == -1)
|
||||
@ -348,5 +348,5 @@ main(int argc, char **argv)
|
||||
free(label);
|
||||
|
||||
/* Pass control to the client. */
|
||||
exit(client_main(event_init(), argc, argv, flags, shellcmd));
|
||||
exit(client_main(event_init(), argc, argv, flags));
|
||||
}
|
||||
|
Reference in New Issue
Block a user