提交 df59afe3 编写于 作者: J Junio C Hamano

Make a short-and-sweet "git-add -i" synonym for "git-add --interactive"

Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 5e1a2e8c
...@@ -7,7 +7,7 @@ git-add - Add file contents to the changeset to be committed next ...@@ -7,7 +7,7 @@ git-add - Add file contents to the changeset to be committed next
SYNOPSIS SYNOPSIS
-------- --------
'git-add' [-n] [-v] [-f] [--interactive] [--] <file>... 'git-add' [-n] [-v] [-f] [--interactive | -i] [--] <file>...
DESCRIPTION DESCRIPTION
----------- -----------
...@@ -52,7 +52,7 @@ OPTIONS ...@@ -52,7 +52,7 @@ OPTIONS
-f:: -f::
Allow adding otherwise ignored files. Allow adding otherwise ignored files.
\--interactive:: \i, \--interactive::
Add modified contents in the working tree interactively to Add modified contents in the working tree interactively to
the index. the index.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "cache-tree.h" #include "cache-tree.h"
static const char builtin_add_usage[] = static const char builtin_add_usage[] =
"git-add [-n] [-v] [-f] [--interactive] [--] <filepattern>..."; "git-add [-n] [-v] [-f] [--interactive | -i] [--] <filepattern>...";
static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix) static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix)
{ {
...@@ -102,7 +102,8 @@ int cmd_add(int argc, const char **argv, const char *prefix) ...@@ -102,7 +102,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
int add_interactive = 0; int add_interactive = 0;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (!strcmp("--interactive", argv[i])) if (!strcmp("--interactive", argv[i]) ||
!strcmp("-i", argv[i]))
add_interactive++; add_interactive++;
} }
if (add_interactive) { if (add_interactive) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册