Replace some calls to die(usage_str) with usage(usage_str).
The only change in behaviour should be having a "usage: " prefix on the output string rather than "fatal: ", and an exit code of 129 rather than 128. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Ramsay Allan Jones committed
Aug 3, 2006 at 16:48 UTC
8cdf33643dc0b21d9ea922a3fdd7f64226c421aa
5 files changed
+7
-7
builtin-add.c
+1
-1
@@ -117,7 +117,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
117
verbose = 1;
118
continue;
119
}
120
- die(builtin_add_usage);
120
+ usage(builtin_add_usage);
121
}
122
pathspec = get_pathspec(prefix, argv + i);
123
builtin-init-db.c
+1
-1
@@ -267,7 +267,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
267
else if (!strncmp(arg, "--shared=", 9))
268
shared_repository = git_config_perm("arg", arg+9);
269
else
270
- die(init_db_usage);
270
+ usage(init_db_usage);
271
}
272
273
/*
builtin-rm.c
+1
-1
@@ -80,7 +80,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
80
force = 1;
81
continue;
82
}
83
- die(builtin_rm_usage);
83
+ usage(builtin_rm_usage);
84
}
85
if (argc <= i)
86
usage(builtin_rm_usage);
builtin-write-tree.c
+1
-1
@@ -73,7 +73,7 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
73
else if (!strncmp(arg, "--prefix=", 9))
74
prefix = arg + 9;
75
else
76
- die(write_tree_usage);
76
+ usage(write_tree_usage);
77
argc--; argv++;
78
}
79
hash-object.c
+3
-3
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
46
if (!no_more_flags && argv[i][0] == '-') {
47
if (!strcmp(argv[i], "-t")) {
48
if (argc <= ++i)
49
- die(hash_object_usage);
49
+ usage(hash_object_usage);
50
type = argv[i];
51
}
52
else if (!strcmp(argv[i], "-w")) {
@@ -66,8 +66,8 @@ int main(int argc, char **argv)
66
hash_stdin(type, write_object);
67
}
68
else
69
- die(hash_object_usage);
70
- }
69
+ usage(hash_object_usage);
70
+ }
71
else {
72
const char *arg = argv[i];
73
if (0 <= prefix_length)