diff --git a/src/command/list.rs b/src/command/list.rs new file mode 100644 index 0000000..23dad11 --- /dev/null +++ b/src/command/list.rs @@ -0,0 +1,20 @@ +#[derive(Default)] +pub struct ListCommand { + uuids: bool +} + +impl ListCommand { + pub fn uuids(mut self) -> Self { + self.uuids = true; + self + } + + pub fn build(self) -> super::Command { + let uuids = self.uuids; + let mut s = format!("list"); + if uuids { + s.push_str(" uuids"); + } + super::Command(s) + } +} \ No newline at end of file diff --git a/src/command/mod.rs b/src/command/mod.rs index 8ad9ea7..e9c5ad9 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,6 +1,7 @@ pub struct Command(String); mod say; +mod list; impl Command { pub fn raw(cmd: &str) -> Self { @@ -14,4 +15,8 @@ impl Command { pub fn say() -> say::SayCommand { say::SayCommand::default() } + + pub fn list() -> list::ListCommand { + list::ListCommand::default() + } } \ No newline at end of file diff --git a/src/command/say.rs b/src/command/say.rs index a395e56..471e694 100644 --- a/src/command/say.rs +++ b/src/command/say.rs @@ -10,7 +10,7 @@ impl SayCommand { } pub fn build(self) -> super::Command { - let message= self.message; + let message = self.message; let s = format!("say {message}"); super::Command(s) }