// Copyright (c) 2008 Hartmut Kaiser // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include "saga-sd.hpp" #include #include /////////////////////////////////////////////////////////////////////////////// int main (int argc, char* argv[]) { #if !defined(SAGA_HAVE_PACKAGE_SD) std::cerr << "saga-sd: saga has been compiled without the sd " "package, bailing out" << std::endl; return -1; #else saga_tools::common c; c.usage ().map () ["list_services"] = " "; // " Example: \n" // " \n" // " saga-sd list_services 'type = org.ogf.saga.service.job \\ \n" // " AND name = CERN-PROD-rb' 'RunningJobs > 10' \n" c.init (argc, argv); c.need_args_min (1); std::vector args = c.args (); try { std::string cmd = args[0]; c.need_args_min (2); if ( cmd == "list_services" ) { c.need_args_min (2); c.need_args_max (3); std::string auth = ""; if ( c.nargs () == 3 ) { auth = args[3]; } list_services (c, args[1], args[2], auth); } else { c.print_usage ("Unknown command"); } } catch ( const saga::exception & e ) { c.fail (e); } return 0; #endif }