From 48a7afec5e50ba091f7724cdb7120c56caf5ad68 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Thu, 16 Feb 2017 16:14:04 -0500 Subject: [PATCH] ... --- tools/ExecutePipeline.cxx | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tools/ExecutePipeline.cxx b/tools/ExecutePipeline.cxx index 2c59a03..0532fa2 100644 --- a/tools/ExecutePipeline.cxx +++ b/tools/ExecutePipeline.cxx @@ -1,7 +1,45 @@ +#include +#include +#include +#include int main( int argc, char* argv[] ) { - return( 0 ); + if( argc < 2 ) + { + std::cerr + << "Usage: " << argv[ 0 ] << " workspace" + << std::endl; + return( 1 ); + + } // fi + + // Get plugins loader + cpPlugins::Interface::Loader loader; + loader.GuessEnvironment( cpPlugins::OS::FileSystem::CanonicalPath( "." ) ); + + int ret = 0; + try + { + // Prepare workspace + cpPlugins::Interface::Workspace::Pointer workspace = + cpPlugins::Interface::Workspace::New( ); + workspace->Load( argv[ 1 ] ); + + // Execute workspace + workspace->PrintExecutionOn( ); + workspace->Update( ); + } + catch( std::exception& err ) + { + std::cerr << "Error caught: " << err.what( ) << std::endl; + ret = 1; + + } // yrt + + // Close connection to loaded plugins file and finish execution + loader.UnRegisterAll( ); + return( ret ); } // eof - $RCSfile$ -- 2.47.1