Macro cmd_lib_macros::use_custom_cmd [−][src]
use_custom_cmd!() { /* proc-macro */ }
import user registered custom command
#[export_cmd(my_cmd)] fn foo(args: CmdArgs, _envs: CmdEnvs) -> FunResult { println!("msg from foo(), args: {:?}", args); Ok("bar".into()) } use_custom_cmd!(my_cmd); run_cmd!(my_cmd)?;
Here we import the previous defined my_cmd
command, so we can run it like a normal command.