aboutsummaryrefslogtreecommitdiff
path: root/builtin-rm.c
diff options
context:
space:
mode:
authorSteven Grimm <koreth@midwinter.com>2007-04-16 00:46:48 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-16 01:06:02 -0700
commitb48caa20de7f62f648de7d3dbb0ceb462879e903 (patch)
treede936d477179d9518e3464824fa0595435083e32 /builtin-rm.c
parentc7263d4d3d75d177f0ad8a8a730e1e3b401488c7 (diff)
downloadgit-b48caa20de7f62f648de7d3dbb0ceb462879e903.tar.gz
git-b48caa20de7f62f648de7d3dbb0ceb462879e903.tar.xz
Add --quiet option to suppress output of "rm" commands for removed files.
Signed-off-by: Steven Grimm <koreth@midwinter.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-rm.c')
-rw-r--r--builtin-rm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin-rm.c b/builtin-rm.c
index 8a0738f83..d3de4b545 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -10,7 +10,7 @@
#include "tree-walk.h"
static const char builtin_rm_usage[] =
-"git-rm [-f] [-n] [-r] [--cached] [--] <file>...";
+"git-rm [-f] [-n] [-r] [--cached] [--quiet] [--] <file>...";
static struct {
int nr, alloc;
@@ -104,7 +104,7 @@ static struct lock_file lock_file;
int cmd_rm(int argc, const char **argv, const char *prefix)
{
int i, newfd;
- int show_only = 0, force = 0, index_only = 0, recursive = 0;
+ int show_only = 0, force = 0, index_only = 0, recursive = 0, quiet = 0;
const char **pathspec;
char *seen;
@@ -132,6 +132,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
force = 1;
else if (!strcmp(arg, "-r"))
recursive = 1;
+ else if (!strcmp(arg, "--quiet"))
+ quiet = 1;
else
usage(builtin_rm_usage);
}
@@ -187,7 +189,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
*/
for (i = 0; i < list.nr; i++) {
const char *path = list.name[i];
- printf("rm '%s'\n", path);
+ if (!quiet)
+ printf("rm '%s'\n", path);
if (remove_file_from_cache(path))
die("git-rm: unable to remove %s", path);