summaryrefslogtreecommitdiffstats
path: root/tmux.c
Side-by-side diff
Diffstat (limited to 'tmux.c') (more/less context) (show whitespace changes)
-rw-r--r--tmux.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/tmux.c b/tmux.c
index 98f0091..ac0e7fb 100644
--- a/tmux.c
+++ b/tmux.c
@@ -55,21 +55,11 @@ u_int status_lines;
void sighandler(int);
+__dead void usage(void);
-void
-usage(char **ptr, const char *fmt, ...)
+__dead void
+usage(void)
{
- char *msg;
- va_list ap;
-
-#define USAGE "usage: %s [-v] [-f file] [-S socket-path]"
- if (fmt == NULL) {
- xasprintf(ptr, USAGE " command [flags]", __progname);
- } else {
- va_start(ap, fmt);
- xvasprintf(&msg, fmt, ap);
- va_end(ap);
-
- xasprintf(ptr, USAGE " %s", __progname, msg);
- xfree(msg);
- }
-#undef USAGE
+ fprintf(stderr,
+ "usage: %s [-v] [-f file] [-S socket-path] command [flags]",
+ __progname);
+ exit(1);
}
@@ -204,3 +194,3 @@ main(int argc, char **argv)
default:
- goto usage;
+ usage();
}
@@ -210,3 +200,3 @@ main(int argc, char **argv)
if (argc == 0)
- goto usage;
+ usage();
@@ -277,4 +267,2 @@ main(int argc, char **argv)
if ((cmd = cmd_parse(argc, argv, &cause)) == NULL) {
- if (cause == NULL)
- goto usage;
log_warnx("%s", cause);
@@ -356,7 +344,2 @@ out:
return (n);
-
-usage:
- usage(&cause, NULL);
- fprintf(stderr, "%s\n", cause);
- exit(1);
}