Thread (48 messages) 48 messages, 3 authors, 2021-07-06
STALE1909d

[RFC PATCH 09/35] update: add options and usage skeleton

From: Felipe Contreras <hidden>
Date: 2021-07-05 12:32:28
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Felipe Contreras <redacted>
---
 builtin/update.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/builtin/update.c b/builtin/update.c
index 51e45b453d..1a69896aa8 100644
--- a/builtin/update.c
+++ b/builtin/update.c
@@ -3,9 +3,19 @@
  */
 
 #include "builtin.h"
+#include "parse-options.h"
 #include "run-command.h"
 #include "dir.h"
 
+static const char * const update_usage[] = {
+	N_("git update"),
+	NULL
+};
+
+static struct option update_options[] = {
+	OPT_END()
+};
+
 static int run_fetch(void)
 {
 	struct strvec args = STRVEC_INIT;
@@ -35,6 +45,8 @@ int cmd_update(int argc, const char **argv, const char *prefix)
 	if (!getenv("GIT_REFLOG_ACTION"))
 		setenv("GIT_REFLOG_ACTION", "update", 0);
 
+	argc = parse_options(argc, argv, prefix, update_options, update_usage, 0);
+
 	if (repo_read_index_unmerged(the_repository))
 		die_resolve_conflict("update");
 
-- 
2.32.0.36.g70aac2b1aa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help