diff options
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -24,7 +24,6 @@ #include <fcntl.h> #include <getopt.h> #include <locale.h> -#include <paths.h> #include <pwd.h> #include <stdlib.h> #include <string.h> @@ -32,7 +31,7 @@ #include "tmux.h" -#ifdef DEBUG +#if defined(DEBUG) && defined(__OpenBSD__) extern char *malloc_options; #endif @@ -54,11 +53,15 @@ char *environ_path; __dead void usage(void); char *makesocketpath(const char *); +#ifndef HAVE___PROGNAME +char *__progname = (char *) "tmux"; +#endif + __dead void usage(void) { fprintf(stderr, - "usage: %s [-2lquv] [-c shell-command] [-f file] [-L socket-name]\n" + "usage: %s [-2lquvV] [-c shell-command] [-f file] [-L socket-name]\n" " [-S socket-path] [command [flags]]\n", __progname); exit(1); @@ -209,7 +212,7 @@ main(int argc, char **argv) long long pid; int opt, flags, keys, session; -#ifdef DEBUG +#if defined(DEBUG) && defined(__OpenBSD__) malloc_options = (char *) "AFGJPX"; #endif @@ -218,7 +221,7 @@ main(int argc, char **argv) flags = 0; label = path = NULL; login_shell = (**argv == '-'); - while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUv")) != -1) { + while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUVv")) != -1) { switch (opt) { case '2': flags |= CLIENT_256COLOURS; @@ -233,6 +236,9 @@ main(int argc, char **argv) else flags |= CLIENT_CONTROL; break; + case 'V': + printf("%s %s\n", __progname, VERSION); + exit(0); case 'f': free(cfg_file); cfg_file = xstrdup(optarg); @@ -373,10 +379,12 @@ main(int argc, char **argv) } free(path); +#ifdef HAVE_SETPROCTITLE /* Set process title. */ setproctitle("%s (%s)", __progname, socket_path); +#endif /* Pass control to the client. */ - ev_base = event_init(); + ev_base = osdep_event_init(); exit(client_main(argc, argv, flags)); } |