// 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" void shell::c_rm (std::string args) { // sanity checks if ( ! cwd_.exists (args) ) { carp ("No such file: " + args); return; } if ( cwd_.is_dir (args) ) { carp ("cannot remove directory: " + args); return; } prompt ("Do you want to remove " + args + "?", "[y/N] >"); std::string input; getline (std::cin, input); if ( input == "y" ) { cwd_.remove (args); } return; }