path: root/builtin.h
diff options
authorRamsay Allan Jones <>2006-07-30 21:42:25 (GMT)
committerJunio C Hamano <>2006-08-02 07:27:18 (GMT)
commit822a7d507151e1d6310f52d5b05234d65db11a88 (patch)
tree649ce1c6b078ed5a040f5ffb91cf847c023a473f /builtin.h
parent8e76483ce0ce256b01345abc4ca97b1f94aed354 (diff)
Remove cmd_usage() routine and re-organize the help/usage code.
The cmd_usage() routine was causing warning messages due to a NULL format parameter being passed in three out of four calls. This is a problem if you want to compile with -Werror. A simple solution is to simply remove the GNU __attribute__ format pragma from the cmd_usage() declaration in the header file. The function interface was somewhat muddled anyway, so re-write the code to finesse the problem. [jc: this incidentally revealed that t9100 test assumed that the output from "git help" to be fixed in stone, but this patch lower-cases "Usage" to "usage". Update the test not to rely on "git help" output.] Signed-off-by: Ramsay Allan Jones <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin.h')
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin.h b/builtin.h
index 88c4d84..f10d3b7 100644
--- a/builtin.h
+++ b/builtin.h
@@ -5,12 +5,9 @@
#include <limits.h>
extern const char git_version_string[];
+extern const char git_usage_string[];
-void cmd_usage(int show_all, const char *exec_path, const char *fmt, ...)
-#ifdef __GNUC__
- __attribute__((__format__(__printf__, 3, 4), __noreturn__))
- ;
+extern void help_unknown_cmd(const char *cmd);
extern int cmd_help(int argc, const char **argv, const char *prefix);
extern int cmd_version(int argc, const char **argv, const char *prefix);