gnuplot_wrapper/commands/
cd.rs

1use crate::{command::Command, script::Script};
2
3/// http://gnuplot.info/docs_5.5/loc6516.html
4pub struct CD {
5    path: String
6}
7
8impl CD {
9    pub fn new(path: &str) -> Self {
10        return CD { path: path.to_owned() };
11    }
12}
13
14impl Command for CD {
15    fn to_raw(&self) -> String {
16        return format!("cd {}", self.path);
17    }
18}
19
20impl Script {
21    pub fn cd(&mut self, path: &str) {
22        self.add_command(CD::new(path));
23    }
24}