index : lsbly
Linux utility to get information on disks/partitions, just like lsblk but better
about summary refs log tree commit diff
lsbly / src / app.rs
-rw-r--r-- blob d1bcd9513d7828b4b9b87d96b4c240980175a06f 589 bytes (plain)
1
use crate::disks::BlockDevice;
2
use clap::{ArgAction, Parser};
3
4
#[derive(Parser, Debug)]
5
#[command(version, about, long_about = None)]
6
pub struct Args {
7
    #[arg(short = 'O', long, action = ArgAction::SetTrue)]
8
    /// output all columns
9
    pub output_all: bool,
10
11
    #[arg(short, long)]
12
    /// output columns see (--list-columns)
13
    pub output: Option<String>
14
}
15
16
#[derive(Debug)]
17
pub struct App {
18
    pub disks: Vec<BlockDevice>,
19
    pub args: Args
20
}
21
22
impl App {
23
    pub fn new(disks: Vec<BlockDevice>) -> Self {
24
        let args = Args::parse();
25
26
        Self { disks, args }
27
    }
28
}