From: Jan Weitzel <j.weitzel@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] crc exit with COMMAND_ERROR_USAGE
Date: Mon, 5 Dec 2011 13:46:24 +0100 [thread overview]
Message-ID: <1323089184-22563-1-git-send-email-j.weitzel@phytec.de> (raw)
If parameter -v without a crc is used, you got a notice but the crc is
calculated and exit status is 0.
With wrong parameters we should quite with COMMAND_ERROR_USAGE.
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
commands/crc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/commands/crc.c b/commands/crc.c
index 01fedd7..8ce97da 100644
--- a/commands/crc.c
+++ b/commands/crc.c
@@ -108,6 +108,8 @@ static int do_crc(struct command *cmdtp, int argc, char *argv[])
verify = 1;
vcrc = simple_strtoul(optarg, NULL, 0);
break;
+ default:
+ return COMMAND_ERROR_USAGE;
}
}
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2011-12-05 12:46 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=1323089184-22563-1-git-send-email-j.weitzel@phytec.de \
--to=j.weitzel@phytec.de \
--cc=barebox@lists.infradead.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