topology: unify CLI and types::Topology (ValueEnum + aliases); bcachefs-2copy uses --replicas=2; update orchestrator call to make_filesystems(cfg); minor overlay fix; docs previously synced

This commit is contained in:
2025-09-29 22:56:23 +02:00
parent 2d43005b07
commit 7cef73368b
7 changed files with 57 additions and 41 deletions

View File

@@ -51,31 +51,8 @@ impl std::fmt::Display for LogLevelArg {
}
}
/// Topology argument (maps to config Topology with snake_case semantics).
#[derive(Debug, Clone, Copy, ValueEnum)]
#[value(rename_all = "kebab_case")]
pub enum TopologyArg {
BtrfsSingle,
BcachefsSingle,
DualIndependent,
SsdHddBcachefs,
Bcachefs2Copy,
BtrfsRaid1,
}
impl std::fmt::Display for TopologyArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
TopologyArg::BtrfsSingle => "btrfs_single",
TopologyArg::BcachefsSingle => "bcachefs_single",
TopologyArg::DualIndependent => "dual_independent",
TopologyArg::SsdHddBcachefs => "ssd_hdd_bcachefs",
TopologyArg::Bcachefs2Copy => "bcachefs_2copy",
TopologyArg::BtrfsRaid1 => "btrfs_raid1",
};
f.write_str(s)
}
}
//// Using crate::types::Topology (ValueEnum) directly for CLI parsing to avoid duplication.
// TopologyArg enum removed; CLI field uses crate::types::Topology
/// zosstorage - one-shot disk initializer for initramfs.
#[derive(Debug, Parser)]
@@ -99,7 +76,7 @@ pub struct Cli {
/// Select topology (overrides config topology)
#[arg(short = 't', long = "topology", value_enum)]
pub topology: Option<TopologyArg>,
pub topology: Option<crate::types::Topology>,
/// Present but non-functional; returns unimplemented error
#[arg(short = 'f', long = "force")]