aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-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