// Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) // // 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 "shell.hpp" // print the state of the job void shell::c_status (std::string args) { // sanity checks if ( args == "" ) { carp ("format: status "); return; } int pid = atoi (args.c_str ()); // get job saga::job job = jobs_.get_job(pid); // get state saga::job::state state = job.get_state (); // show state std::cout << state_to_string (state) << std::endl; // purge old entries if ( state == saga::job::Done || state == saga::job::Failed || state == saga::job::Canceled ) { jobs_.del (pid); } return; }