[darwinbuild-changes] [645] branches/PR-7250612/darwinup/main.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Mon Dec 7 13:34:09 PST 2009
Revision: 645
http://trac.macosforge.org/projects/darwinbuild/changeset/645
Author: wsiegrist at apple.com
Date: 2009-12-07 13:34:08 -0800 (Mon, 07 Dec 2009)
Log Message:
-----------
Add -f option to force operations to do unsafe things.
Modified Paths:
--------------
branches/PR-7250612/darwinup/main.cpp
Modified: branches/PR-7250612/darwinup/main.cpp
===================================================================
--- branches/PR-7250612/darwinup/main.cpp 2009-12-07 16:52:13 UTC (rev 644)
+++ branches/PR-7250612/darwinup/main.cpp 2009-12-07 21:34:08 UTC (rev 645)
@@ -36,6 +36,7 @@
fprintf(stderr, "usage: %s [-v] [-p DIR] [command] [args] \n", progname);
fprintf(stderr, " \n");
fprintf(stderr, "options: \n");
+ fprintf(stderr, " -f force operation to succeed at all costs \n");
fprintf(stderr, " -p DIR operate on roots under DIR (default: /) \n");
fprintf(stderr, " -v verbose (use -vv for extra verbosity) \n");
fprintf(stderr, " \n");
@@ -50,6 +51,7 @@
// our globals
uint32_t verbosity;
+uint32_t force;
int main(int argc, char* argv[]) {
char* progname = strdup(basename(argv[0]));
@@ -57,12 +59,12 @@
char* path = NULL;
int ch;
- while ((ch = getopt(argc, argv, "p:v")) != -1) {
+ while ((ch = getopt(argc, argv, "fp:v")) != -1) {
switch (ch) {
- case 'v':
- verbosity <<= 1;
- verbosity |= VERBOSE;
- break;
+ case 'f':
+ fprintf(stderr, "DEBUG: forcing operations\n");
+ force = 1;
+ break;
case 'p':
if (optarg[0] != '/') {
fprintf(stderr, "Error: -p option must be an absolute path\n");
@@ -72,11 +74,15 @@
fprintf(stderr, "Error: -p option value is too long \n");
exit(4);
}
- join_path(&path, optarg, "/");
- break;
+ join_path(&path, optarg, "/");
+ break;
+ case 'v':
+ verbosity <<= 1;
+ verbosity |= VERBOSE;
+ break;
case '?':
default:
- usage(progname);
+ usage(progname);
}
}
argc -= optind;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20091207/d751bb50/attachment.html>
More information about the darwinbuild-changes
mailing list