]>
Commit | Line | Data |
---|---|---|
0fcfd160 LT |
1 | /* |
2 | * GIT - The information manager from hell | |
3 | * | |
4 | * Copyright (C) Linus Torvalds, 2005 | |
5 | */ | |
4050c0df | 6 | #include "git-compat-util.h" |
0fcfd160 LT |
7 | |
8 | static void report(const char *prefix, const char *err, va_list params) | |
9 | { | |
10 | fputs(prefix, stderr); | |
11 | vfprintf(stderr, err, params); | |
12 | fputs("\n", stderr); | |
13 | } | |
14 | ||
15 | void usage(const char *err) | |
16 | { | |
17 | fprintf(stderr, "usage: %s\n", err); | |
5d1a5c02 | 18 | exit(129); |
0fcfd160 LT |
19 | } |
20 | ||
21 | void die(const char *err, ...) | |
22 | { | |
23 | va_list params; | |
24 | ||
25 | va_start(params, err); | |
26 | report("fatal: ", err, params); | |
27 | va_end(params); | |
5d1a5c02 | 28 | exit(128); |
0fcfd160 LT |
29 | } |
30 | ||
31 | int error(const char *err, ...) | |
32 | { | |
33 | va_list params; | |
34 | ||
35 | va_start(params, err); | |
36 | report("error: ", err, params); | |
37 | va_end(params); | |
38 | return -1; | |
39 | } |