Documentation
use psdk_father::args::{ArgContext, PsdkArgBase, PsdkEasyArg};
use psdk_father::command::CommandClause;
use psdk_father::errors::PsdkFatherResult;
use std::sync::{Arc, Mutex};

#[derive(Clone, Debug)]
pub struct CGap {
  ctx: Arc<Mutex<ArgContext>>,
}

impl Default for CGap {
  fn default() -> Self {
    Self::new()
  }
}

impl CGap {
  pub fn new() -> Self {
    Self {
      ctx: Default::default(),
    }
  }
}

impl PsdkEasyArg<String> for CGap {
  fn context(&self) -> Arc<Mutex<ArgContext>> {
    self.ctx.clone()
  }
}

impl PsdkArgBase<String> for CGap {
  fn header(&self) -> String {
    "GAP-SENSE".to_string()
  }

  fn clause(&self) -> PsdkFatherResult<CommandClause> {
    Ok(CommandClause::with_text(self.header()))
  }
}

psdk_father::impl_psdk_arg_to_easy_arg!(String, CGap, true);