From: Stephen Boyd <bebarino@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Sixt <j.sixt@viscovery.net>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCHv3 1/2] read-tree: convert unhelpful usage()'s to helpful die()'s
Date: Thu, 25 Jun 2009 22:14:09 -0700 [thread overview]
Message-ID: <1245993250-8213-1-git-send-email-bebarino@gmail.com> (raw)
In-Reply-To: <1245817672-25483-1-git-send-email-bebarino@gmail.com>
Printing the usage message when encountering bad option combinations is
not very helpful. Instead, die with a message which tells the user
exactly what combination is invalid.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
Added --prefix and --reset to the second die message.
builtin-read-tree.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 82e25ea..17c9631 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -145,9 +145,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
continue;
}
- /* using -u and -i at the same time makes no sense */
if (1 < opts.index_only + opts.update)
- usage(read_tree_usage);
+ die("-u and -i at the same time makes no sense");
if (get_sha1(arg, sha1))
die("Not a valid object name %s", arg);
@@ -156,7 +155,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
stage++;
}
if ((opts.update||opts.index_only) && !opts.merge)
- usage(read_tree_usage);
+ die("%s is meaningless without -m, --reset, or --prefix",
+ opts.update ? "-u" : "-i");
if ((opts.dir && !opts.update))
die("--exclude-per-directory is meaningless unless -u");
if (opts.merge && !opts.index_only)
--
1.6.3.3.334.g916e1
next prev parent reply other threads:[~2009-06-26 5:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 4:27 [PATCH 1/2] read-tree: convert unhelpful usage()'s to helpful die()'s Stephen Boyd
2009-06-24 4:27 ` [PATCH 2/2] read-tree: migrate to parse-options Stephen Boyd
2009-06-24 5:08 ` Junio C Hamano
2009-06-25 1:36 ` Stephen Boyd
2009-06-25 5:06 ` [PATCHv2 " Stephen Boyd
2009-06-25 6:55 ` Johannes Sixt
2009-06-26 3:15 ` Stephen Boyd
2009-06-26 5:14 ` Stephen Boyd [this message]
2009-06-26 5:14 ` [PATCHv3 " Stephen Boyd
2009-06-26 5:29 ` Stephen Boyd
2009-06-26 17:23 ` Junio C Hamano
2009-06-27 2:00 ` Stephen Boyd
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245993250-8213-1-git-send-email-bebarino@gmail.com \
--to=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).