refact: dabble in macros a bit
This commit is contained in:
parent
01c7a889db
commit
eeda98e41c
1 changed files with 12 additions and 16 deletions
|
|
@ -1,17 +1,13 @@
|
||||||
mod hello;
|
macro_rules! command {
|
||||||
pub use hello::Hello;
|
($mod:ident::$cmd:ident) => {
|
||||||
|
mod $mod;
|
||||||
|
pub use $mod::$cmd;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
mod cat;
|
command!(hello::Hello);
|
||||||
pub use cat::Cat;
|
command!(cat::Cat);
|
||||||
|
command!(echo::Echo);
|
||||||
mod echo;
|
command!(mkdir::Mkdir);
|
||||||
pub use echo::Echo;
|
command!(dd::Dd);
|
||||||
|
command!(nproc::Nproc);
|
||||||
mod mkdir;
|
|
||||||
pub use mkdir::Mkdir;
|
|
||||||
|
|
||||||
mod dd;
|
|
||||||
pub use dd::Dd;
|
|
||||||
|
|
||||||
mod nproc;
|
|
||||||
pub use nproc::Nproc;
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue