aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-09-14 23:59:39 +0000
committerMike Buland <eichlan@xagasoft.com>2006-09-14 23:59:39 +0000
commit5a32418a040e967887aa6e01e41abc22932471db (patch)
treeb43cd556e925cd07d2a25be622c7894a1c76e794 /src/main.cpp
parentc831a3947d7ac517fceaf8981d56c5ddcdaf26b1 (diff)
downloadbuild-5a32418a040e967887aa6e01e41abc22932471db.tar.gz
build-5a32418a040e967887aa6e01e41abc22932471db.tar.bz2
build-5a32418a040e967887aa6e01e41abc22932471db.tar.xz
build-5a32418a040e967887aa6e01e41abc22932471db.zip
Made more changes, this one has a little extra debug, get the next one.
Diffstat (limited to '')
-rw-r--r--src/main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 03004fc..1576b0c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,6 +13,7 @@ public:
13 sFile("build.conf"), 13 sFile("build.conf"),
14 sCache(".build.cache"), 14 sCache(".build.cache"),
15 bDebug( false ), 15 bDebug( false ),
16 bPostDebug( false ),
16 sView("plain") 17 sView("plain")
17 { 18 {
18 addHelpBanner("Build r?\n\n"); 19 addHelpBanner("Build r?\n\n");
@@ -25,7 +26,9 @@ public:
25 addParam("cache", &sCache, 26 addParam("cache", &sCache,
26 "Set an alternative cache file." ); 27 "Set an alternative cache file." );
27 addParam('d', &bDebug, 28 addParam('d', &bDebug,
28 "Print out a debug dump of the build.conf", NULL, "true" ); 29 "Display debug info instead of building", NULL, "true" );
30 addParam('D', &bPostDebug,
31 "Display debug info after building", NULL, "true" );
29 addParam("help", mkproc(ParamProc::help), 32 addParam("help", mkproc(ParamProc::help),
30 "This help"); 33 "This help");
31 //pViewer = new ViewerPlain; 34 //pViewer = new ViewerPlain;
@@ -63,6 +66,7 @@ public:
63 StaticString sAction; 66 StaticString sAction;
64 //Viewer *pViewer; 67 //Viewer *pViewer;
65 bool bDebug; 68 bool bDebug;
69 bool bPostDebug;
66 70
67private: 71private:
68}; 72};
@@ -92,11 +96,21 @@ int main( int argc, char *argv[] )
92 else 96 else
93 pBuild->execAction(""); 97 pBuild->execAction("");
94 } 98 }
99 if( prm.bPostDebug )
100 {
101 printf("\n\n----------\nDebug dump\n----------\n");
102 pBuild->debugDump();
103 }
95 } 104 }
96 catch( BuildException &e ) 105 catch( BuildException &e )
97 { 106 {
98 fputs( e.what(), stderr ); 107 fputs( e.what(), stderr );
99 fputs( "\n", stderr ); 108 fputs( "\n", stderr );
109 if( prm.bPostDebug )
110 {
111 printf("\n\n----------\nDebug dump\n----------\n");
112 pBuild->debugDump();
113 }
100 return 1; 114 return 1;
101 } 115 }
102 116