Skip to main content

vlib_cli_command

Attribute Macro vlib_cli_command 

Source
#[vlib_cli_command]
Expand description

Creates a CLI command function

§Attributes

  • path: (required, string literal) The CLI command path.
  • short_help: (optional, string literal) A short help string for the CLI command.

§Examples

#[vlib_cli_command(
    path = "rust-example",
    short_help = "rust-example <interface-name> [disable]",
)]
fn enable_disable_command(_vm: &mut vlib::BarrierHeldMainRef, _input: &str) -> Result<(), ErrorStack> {
    Ok(())
}