use super::Cmd; use clap::{Arg, ArgAction, Command}; #[derive(Debug)] pub struct Mountpoint { name: &'static str, path: Option, } pub const MOUNTPOINT: Mountpoint = Mountpoint { name: "mountpoint", path: Some(crate::Path::Bin), }; impl Cmd for Mountpoint { fn name(&self) -> &str { self.name } fn cli(&self) -> clap::Command { Command::new(self.name) .about("see if a directory or file is a mountpoint") .author("Nathan Fisher") .args([ Arg::new("fs-devno") .help("Show the major/minor numbers of the device that is mounted on the given directory.") .short('d') .long("fs-devno") .action(ArgAction::SetTrue), Arg::new("devno") .help("Show the major/minor numbers of the given blockdevice on standard output.") .short('x') .long("devno") .conflicts_with("fs-devno") .action(ArgAction::SetTrue), Arg::new("quiet") .help("Be quiet - don’t print anything.") .short('q') .long("quiet") .action(ArgAction::SetTrue), ]) } fn run(&self, matches: Option<&clap::ArgMatches>) -> Result<(), Box> { unimplemented!(); } fn path(&self) -> Option { self.path } }