parallel_disk_usage/args/
quantity.rs

1#[cfg(feature = "cli")]
2use clap::ValueEnum;
3
4/// Quantity to be measured.
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6#[cfg_attr(feature = "cli", derive(ValueEnum))]
7pub enum Quantity {
8    /// Measure apparent sizes.
9    ApparentSize,
10    /// Measure block sizes (block-count * 512B).
11    #[cfg(unix)]
12    BlockSize,
13    /// Count numbers of blocks.
14    #[cfg(unix)]
15    BlockCount,
16}
17
18impl Quantity {
19    /// Default value of the `--quantity` flag.
20    #[cfg(unix)]
21    pub(crate) const DEFAULT: Self = Quantity::BlockSize;
22    /// Default value of the `--quantity` flag.
23    #[cfg(not(unix))]
24    pub(crate) const DEFAULT: Self = Quantity::ApparentSize;
25}