Skip to content

Commit

Permalink
Replace some calls to die(usage_str) with usage(usage_str).
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramsay Allan Jones authored and Junio C Hamano committed Aug 4, 2006
1 parent 15e593e commit 8cdf336
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion builtin-add.c
Expand Up @@ -117,7 +117,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
verbose = 1;
continue;
}
die(builtin_add_usage);
usage(builtin_add_usage);
}
pathspec = get_pathspec(prefix, argv + i);

Expand Down
2 changes: 1 addition & 1 deletion builtin-init-db.c
Expand Up @@ -267,7 +267,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
else if (!strncmp(arg, "--shared=", 9))
shared_repository = git_config_perm("arg", arg+9);
else
die(init_db_usage);
usage(init_db_usage);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion builtin-rm.c
Expand Up @@ -80,7 +80,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
force = 1;
continue;
}
die(builtin_rm_usage);
usage(builtin_rm_usage);
}
if (argc <= i)
usage(builtin_rm_usage);
Expand Down
2 changes: 1 addition & 1 deletion builtin-write-tree.c
Expand Up @@ -73,7 +73,7 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
else if (!strncmp(arg, "--prefix=", 9))
prefix = arg + 9;
else
die(write_tree_usage);
usage(write_tree_usage);
argc--; argv++;
}

Expand Down
6 changes: 3 additions & 3 deletions hash-object.c
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char **argv)
if (!no_more_flags && argv[i][0] == '-') {
if (!strcmp(argv[i], "-t")) {
if (argc <= ++i)
die(hash_object_usage);
usage(hash_object_usage);
type = argv[i];
}
else if (!strcmp(argv[i], "-w")) {
Expand All @@ -66,8 +66,8 @@ int main(int argc, char **argv)
hash_stdin(type, write_object);
}
else
die(hash_object_usage);
}
usage(hash_object_usage);
}
else {
const char *arg = argv[i];
if (0 <= prefix_length)
Expand Down

0 comments on commit 8cdf336

Please sign in to comment.