From: Dmitry Potapov Date: Sun, 13 Sep 2009 12:05:52 +0000 (+0400) Subject: git-archive: add '-o' as a alias for '--output' X-Git-Tag: v1.6.5-rc2~36 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=05d3951ec9c531d348fe0dbb9ae058d38728a550;p=git.git git-archive: add '-o' as a alias for '--output' The '-o' option is commonly used in many tools to specify the output file. Typing '--output' every time is a bit too long to be a practical alternative to redirecting output. But specifying the output name has the advantage of making possible to guess the desired output format by filename extension. Signed-off-by: Dmitry Potapov Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index 92444ddf1..1917f2e8a 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git archive' [--format=] [--list] [--prefix=/] [] - [--output=] [--worktree-attributes] + [-o | --output=] [--worktree-attributes] [--remote= [--exec=]] [path...] @@ -48,6 +48,7 @@ OPTIONS --prefix=/:: Prepend / to each filename in the archive. +-o :: --output=:: Write the archive to instead of stdout. diff --git a/archive.c b/archive.c index 0bca9ca40..73b8e8a56 100644 --- a/archive.c +++ b/archive.c @@ -283,7 +283,7 @@ static int parse_archive_args(int argc, const char **argv, OPT_STRING(0, "format", &format, "fmt", "archive format"), OPT_STRING(0, "prefix", &base, "prefix", "prepend prefix to each pathname in the archive"), - OPT_STRING(0, "output", &output, "file", + OPT_STRING('o', "output", &output, "file", "write the archive to this file"), OPT_BOOLEAN(0, "worktree-attributes", &worktree_attributes, "read .gitattributes in working directory"), diff --git a/builtin-archive.c b/builtin-archive.c index f9a4bea41..565314b04 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -71,7 +71,7 @@ int cmd_archive(int argc, const char **argv, const char *prefix) const char *output = NULL; const char *remote = NULL; struct option local_opts[] = { - OPT_STRING(0, "output", &output, "file", + OPT_STRING('o', "output", &output, "file", "write the archive to this file"), OPT_STRING(0, "remote", &remote, "repo", "retrieve the archive from remote repository "),