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 15a93c9a1cd6caccf9d9c0d6ed6c2935d1958432 556 bytes (plain)
1
use clap::{ArgAction, Parser};
2
use sysinfo::Disks;
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: Disks,
19
    pub args: Args
20
}
21
22
impl App {
23
    pub fn new(disks: Disks) -> Self {
24
        let args = Args::parse();
25
26
        Self { disks, args }
27
    }
28
}