aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 712213b..fa1608f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,7 +12,8 @@ public:
12 Param() : 12 Param() :
13 sFile("build.conf"), 13 sFile("build.conf"),
14 sCache(".build.cache"), 14 sCache(".build.cache"),
15 bDebug( false ) 15 bDebug( false ),
16 sView("plain")
16 { 17 {
17 addHelpBanner("Build r?\n\n"); 18 addHelpBanner("Build r?\n\n");
18 addParam("file", 'f', &sFile, 19 addParam("file", 'f', &sFile,
@@ -24,7 +25,7 @@ public:
24 addParam("cache", &sCache, 25 addParam("cache", &sCache,
25 "Set an alternative cache file." ); 26 "Set an alternative cache file." );
26 addParam('d', &bDebug, 27 addParam('d', &bDebug,
27 "Print out a debug dump of the read build.conf", "true" ); 28 "Print out a debug dump of the build.conf", NULL, "true" );
28 addParam("help", mkproc(ParamProc::help), 29 addParam("help", mkproc(ParamProc::help),
29 "This help"); 30 "This help");
30 //pViewer = new ViewerPlain; 31 //pViewer = new ViewerPlain;
@@ -48,6 +49,7 @@ public:
48 49
49 int procViewPercent( int argc, char *argv[] ) 50 int procViewPercent( int argc, char *argv[] )
50 { 51 {
52 sView = "percent";
51 //delete pViewer; 53 //delete pViewer;
52 //pViewer = new ViewerPercent; 54 //pViewer = new ViewerPercent;
53 } 55 }
@@ -60,6 +62,7 @@ public:
60 62
61 std::string sCache; 63 std::string sCache;
62 std::string sFile; 64 std::string sFile;
65 std::string sView;
63 StaticString sAction; 66 StaticString sAction;
64 //Viewer *pViewer; 67 //Viewer *pViewer;
65 bool bDebug; 68 bool bDebug;
@@ -79,6 +82,19 @@ int main( int argc, char *argv[] )
79 { 82 {
80 pBuild = bld.load( prm.sFile.c_str() ); 83 pBuild = bld.load( prm.sFile.c_str() );
81 pBuild->setCache( prm.sCache ); 84 pBuild->setCache( prm.sCache );
85 pBuild->setView( prm.sView );
86 if( prm.bDebug )
87 {
88 printf("\n\n----------\nDebug dump\n----------\n");
89 bld.debugDump();
90 }
91 else
92 {
93 if( prm.sAction > 0 )
94 pBuild->execAction( prm.sAction.getString() );
95 else
96 pBuild->execAction("");
97 }
82 } 98 }
83 catch( BuildException &e ) 99 catch( BuildException &e )
84 { 100 {
@@ -87,21 +103,6 @@ int main( int argc, char *argv[] )
87 return 1; 103 return 1;
88 } 104 }
89 105
90 //if( prm.bDebug )
91 //{
92 // printf("\n\n----------\nDebug dump\n----------\n");
93 // bld.debugDump();
94 //}
95 //else
96 {
97 if( prm.sAction > 0 )
98 pBuild->execAction( prm.sAction.getString() );
99 else
100 pBuild->execAction("");
101 }
102 //printf("\n\n----------\nDebug dump\n----------\n");
103 //pBuild->debugDump();
104
105 delete pBuild; 106 delete pBuild;
106} 107}
107 108