bird_tool_utils_man/
example.rs1#[derive(Debug, Clone, Default)]
3pub struct Example {
4 pub(crate) prompt: &'static str,
5 pub(crate) text: Option<&'static str>,
6 pub(crate) command: Option<&'static str>,
7 pub(crate) output: Option<&'static str>,
8}
9
10impl Example {
11 pub fn new() -> Self {
12 Self {
13 prompt: "$",
14 text: None,
15 command: None,
16 output: None,
17 }
18 }
19
20 pub fn prompt(mut self, prompt: &'static str) -> Self {
21 self.prompt = prompt;
22 self
23 }
24
25 pub fn text(mut self, text: &'static str) -> Self {
26 self.text = Some(text);
27 self
28 }
29
30 pub fn command(mut self, command: &'static str) -> Self {
31 self.command = Some(command);
32 self
33 }
34
35 pub fn output(mut self, output: &'static str) -> Self {
36 self.output = Some(output);
37 self
38 }
39}