git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Add usage string to git-update-index

From
Petr Baudis <pasky@suse.cz>
Date
Oct 25, 2005, 15:26 UTC
Message-ID
<20051025152625.17299.10333.stgit@machine.or.cz>

This patch adds usage string to git-update-index, can be printed by the -h or --help parameter.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 update-index.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/update-index.c b/update-index.c
index a84836b..661b86a 100644
--- a/update-index.c
+++ b/update-index.c
@@ -392,6 +392,9 @@ static void read_index_info(int line_ter
 	}
 }
 
+static const char update_index_usage[] =
+"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--cacheinfo] [--chmod=(+|-)x] [--info-only] [--force-remove] [--stdin] [--index-info] [--ignore-missing] [-z] [--version] [--] <file>...";
+
 int main(int argc, const char **argv)
 {
 	int i, newfd, entries, has_errors = 0, line_termination = '\n';
@@ -489,6 +492,8 @@ int main(int argc, const char **argv)
 				verbose = 1;
 				continue;
 			}
+			if (!strcmp(path, "-h") || !strcmp(path, "--help"))
+				usage(update_index_usage);
 			die("unknown option %s", path);
 		}
 		update_one(path, prefix, prefix_length);
Message 1 of 1 in “Add usage string to git-update-index”
  1. Add usage string to git-update-indexPetr Baudis, Oct 25, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.