diff --git a/plugin/src/lib.rs b/plugin/src/lib.rs index 432a4fa..186f4e6 100644 --- a/plugin/src/lib.rs +++ b/plugin/src/lib.rs @@ -12,8 +12,8 @@ //! # Quick start //! //! ```no_run -//! use cni_plugin::{Cni, install_logger}; -//! install_logger("hello-world.log"); +//! use cni_plugin::{Cni, logger}; +//! logger::install(env!("CARGO_PKG_NAME")); //! match Cni::load() { //! Cni::Add { container_id, ifname, netns, path, config } => {} //! Cni::Del { container_id, ifname, netns, path, config } => {} @@ -21,6 +21,17 @@ //! Cni::Version(_) => unreachable!() //! } //! ``` +//! +//! or: +//! +//! ```no_run +//! use cni_plugin::{Cni, Inputs, logger}; +//! logger::install(env!("CARGO_PKG_NAME")); +//! +//! let Inputs { +//! command, container_id, ifname, netns, path, config +//! } = match Cni::load().into_inputs().unwrap(); +//! ``` pub use cni::Cni; pub use command::Command;