[PATCH] git-diff-*: --name-only and --name-only-z.
[git/jrn.git] / usage.c
blob86211c9141b788f6dbdf7b192f0ac4f4e2527d64
1 /*
2 * GIT - The information manager from hell
4 * Copyright (C) Linus Torvalds, 2005
5 */
6 #include "cache.h"
8 static void report(const char *prefix, const char *err, va_list params)
10 fputs(prefix, stderr);
11 vfprintf(stderr, err, params);
12 fputs("\n", stderr);
15 void usage(const char *err)
17 fprintf(stderr, "usage: %s\n", err);
18 exit(1);
21 void die(const char *err, ...)
23 va_list params;
25 va_start(params, err);
26 report("fatal: ", err, params);
27 va_end(params);
28 exit(1);
31 int error(const char *err, ...)
33 va_list params;
35 va_start(params, err);
36 report("error: ", err, params);
37 va_end(params);
38 return -1;