gnuplot_wrapper/commands/cd.rs
use crate::{command::Command, script::Script};
/// http://gnuplot.info/docs_5.5/loc6516.html
pub struct CD {
path: String
}
impl CD {
pub fn new(path: &str) -> Self {
return CD { path: path.to_owned() };
}
}
impl Command for CD {
fn to_raw(&self) -> String {
return format!("cd {}", self.path);
}
}
impl Script {
pub fn cd(&mut self, path: &str) {
self.add_command(CD::new(path));
}
}