Skip to main content

slash_lib/builtins/
mod.rs

1mod echo;
2mod exec;
3mod find;
4mod read;
5mod write;
6
7#[cfg(feature = "obfsck")]
8mod obfsck;
9
10pub use echo::Echo;
11pub use exec::Exec;
12pub use find::Find;
13pub use read::Read;
14pub use write::Write;
15
16#[cfg(feature = "obfsck")]
17pub use obfsck::Obfsck;
18
19use crate::command::SlashCommand;
20
21/// Returns all built-in commands.
22pub fn all() -> Vec<Box<dyn SlashCommand>> {
23    #[allow(unused_mut)]
24    let mut v: Vec<Box<dyn SlashCommand>> = vec![
25        Box::new(Echo),
26        Box::new(Read),
27        Box::new(Write),
28        Box::new(Exec),
29        Box::new(Find),
30    ];
31    #[cfg(feature = "obfsck")]
32    v.push(Box::new(Obfsck));
33    v
34}