#[cfg(not(target_arch = "wasm32"))]
pub mod cli;
#[cfg(not(target_arch = "wasm32"))]
pub mod commands;
#[cfg(not(target_arch = "wasm32"))]
mod error;
#[cfg(not(target_arch = "wasm32"))]
pub(crate) mod helpers;
#[cfg(not(target_arch = "wasm32"))]
pub use error::Error;
#[cfg(not(target_arch = "wasm32"))]
pub type Result<T> = std::result::Result<T, error::Error>;
pub use helpers::{messages::*, USER};
use serde::{Deserialize, Serialize};
#[doc(hidden)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CommandTree {
pub name: String,
pub commands: Vec<CommandTree>,
}
impl From<&clap::Command> for CommandTree {
fn from(value: &clap::Command) -> Self {
CommandTree {
name: value.get_name().to_string(),
commands: value.get_subcommands().map(|c| c.into()).collect(),
}
}
}