From 22d5f14f156b0d385b86a83f15b350efede49ea5 Mon Sep 17 00:00:00 2001 From: ewt Date: Mon, 20 Jan 1997 22:16:01 +0000 Subject: [PATCH] 1) sanity check --timecheck 2) print usefull errors during argument processing CVS patchset: 1325 CVS date: 1997/01/20 22:16:01 --- rpm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rpm.c b/rpm.c index 21ebe48..9278e36 100755 --- a/rpm.c +++ b/rpm.c @@ -390,7 +390,7 @@ int main(int argc, char ** argv) { int noPgp = 0, dump = 0, initdb = 0, ignoreArch = 0, showrc = 0; int gotDbpath = 0, building = 0, ignoreOs = 0, noFiles = 0, verifyFlags; char *tce; - int timeCheck; + int timeCheck = 0; int addSign = NEW_SIGNATURE; char * rcfile = NULL, * queryFormat = NULL, * prefix = NULL; char buildChar = ' '; @@ -814,7 +814,9 @@ int main(int argc, char ** argv) { if (help) printHelp(); if (arg < -1) { - fprintf(stderr, "bad option\n"); + fprintf(stderr, "%s: %s\n", + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + poptStrerror(arg)); exit(1); } @@ -844,6 +846,10 @@ int main(int argc, char ** argv) { bigMode != MODE_INITDB && gotDbpath) argerror(_("--dbpath given for operation that does not use a " "database")); + + if (timeCheck && bigMode != MODE_BUILD && bigMode != MODE_REBUILD && + bigMode != MODE_RECOMPILE) + argerror(_("--timecheck may only be used during package builds")); if (bigMode != MODE_QUERY && queryFor) argerror(_("unexpected query specifiers")); -- 2.7.4