diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-06-19 19:38:45 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-19 19:38:45 (GMT) |
commit | 50ad8561dee9d479e41586689486cbbb4a742f7b (patch) | |
tree | 41687648bc7b1674a109fdeb490b9b749f458fde /builtin/remote-fd.c | |
parent | 06959fe0e1f50608ff872be386a7c53d97f885f4 (diff) | |
parent | d691551192ac845747694258ccae9ffeeb6bdd58 (diff) | |
download | git-50ad8561dee9d479e41586689486cbbb4a742f7b.zip git-50ad8561dee9d479e41586689486cbbb4a742f7b.tar.gz git-50ad8561dee9d479e41586689486cbbb4a742f7b.tar.bz2 |
Merge branch 'jk/consistent-h'
"git $cmd -h" for builtin commands calls the implementation of the
command (i.e. cmd_$cmd() function) without doing any repository
set-up, and the commands that expect RUN_SETUP is done by the Git
potty needs to be prepared to show the help text without barfing.
* jk/consistent-h:
t0012: test "-h" with builtins
git: add hidden --list-builtins option
version: convert to parse-options
diff- and log- family: handle "git cmd -h" early
submodule--helper: show usage for "-h"
remote-{ext,fd}: print usage message on invalid arguments
upload-archive: handle "-h" option early
credential: handle invalid arguments earlier
Diffstat (limited to 'builtin/remote-fd.c')
-rw-r--r-- | builtin/remote-fd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c index 08d7121..91dfe07 100644 --- a/builtin/remote-fd.c +++ b/builtin/remote-fd.c @@ -1,6 +1,9 @@ #include "builtin.h" #include "transport.h" +static const char usage_msg[] = + "git remote-fd <remote> <url>"; + /* * URL syntax: * 'fd::<inoutfd>[/<anything>]' Read/write socket pair @@ -57,7 +60,7 @@ int cmd_remote_fd(int argc, const char **argv, const char *prefix) char *end; if (argc != 3) - die("Expected two arguments"); + usage(usage_msg); input_fd = (int)strtoul(argv[2], &end, 10); |