Show usage string for 'git show-index -h'

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder 2009-11-09 09:04:55 -06:00 committed by Junio C Hamano
parent 7006b5bece
commit 03c5c10263

View File

@ -1,6 +1,9 @@
#include "cache.h" #include "cache.h"
#include "pack.h" #include "pack.h"
static const char show_index_usage[] =
"git show-index < <packed archive index>";
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int i; int i;
@ -8,6 +11,8 @@ int main(int argc, char **argv)
unsigned int version; unsigned int version;
static unsigned int top_index[256]; static unsigned int top_index[256];
if (argc != 1)
usage(show_index_usage);
if (fread(top_index, 2 * 4, 1, stdin) != 1) if (fread(top_index, 2 * 4, 1, stdin) != 1)
die("unable to read header"); die("unable to read header");
if (top_index[0] == htonl(PACK_IDX_SIGNATURE)) { if (top_index[0] == htonl(PACK_IDX_SIGNATURE)) {