git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Fonseca <fonseca@diku.dk>
To: git@vger.kernel.org
Subject: [PATCH] mv: allow verbosity to be enabled using -v
Date: Mon, 1 Oct 2007 12:27:34 +0200	[thread overview]
Message-ID: <20071001102734.GB8315@diku.dk> (raw)

The infrastructure was already there but the option parsing for it was
missing. Also, move full command line documentation to synopsis section.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
 Documentation/git-mv.txt |   10 +++++-----
 builtin-mv.c             |    6 +++++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt
index 2c9cf74..9cd1177 100644
--- a/Documentation/git-mv.txt
+++ b/Documentation/git-mv.txt
@@ -8,15 +8,14 @@ git-mv - Move or rename a file, a directory, or a symlink
 
 SYNOPSIS
 --------
-'git-mv' <options>... <args>...
+[verse]
+'git-mv' [-f] [-n] [-v] <source> <destination>
+'git-mv' [-f] [-n] [-v] [-k] <source> ... <destination directory>
 
 DESCRIPTION
 -----------
 This script is used to move or rename a file, directory or symlink.
 
- git-mv [-f] [-n] <source> <destination>
- git-mv [-f] [-n] [-k] <source> ... <destination directory>
-
 In the first form, it renames <source>, which must exist and be either
 a file, symlink or directory, to <destination>.
 In the second form, the last argument has to be an existing
@@ -36,7 +35,8 @@ OPTIONS
         file unless '-f' is given.
 -n::
 	Do nothing; only show what would happen
-
+-v::
+	Be verbose.
 
 Author
 ------
diff --git a/builtin-mv.c b/builtin-mv.c
index b944651..620998e 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -10,7 +10,7 @@
 #include "path-list.h"
 
 static const char builtin_mv_usage[] =
-"git-mv [-n] [-f] (<source> <destination> | [-k] <source>... <destination>)";
+"git-mv [-n] [-f] [-v] (<source> <destination> | [-k] <source>... <destination>)";
 
 static const char **copy_pathspec(const char *prefix, const char **pathspec,
 				  int count, int base_name)
@@ -99,6 +99,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 			ignore_errors = 1;
 			continue;
 		}
+		if (!strcmp(arg, "-v")) {
+			verbose = 1;
+			continue;
+		}
 		usage(builtin_mv_usage);
 	}
 	count = argc - i - 1;
-- 
1.5.3.2.1029.gc1d178

-- 
Jonas Fonseca

                 reply	other threads:[~2007-10-01 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071001102734.GB8315@diku.dk \
    --to=fonseca@diku.dk \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).