// 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" // change the working directory void shell::c_cd (std::string args) { // have a nice default if ( args == "" ) { cwd_.change_dir (home_); return; } // sanity checks if ( ! cwd_.exists (args) ) { carp ("No such directory: " + args); return; } if ( ! cwd_.is_dir (args) ) { carp ("Not a directory: " + args); return; } // do! :-) cwd_.change_dir (args); return; }