make list use Option

This commit is contained in:
Raptorox 2026-07-28 17:25:04 +02:00
parent 3122f68720
commit 398615573c
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8

View file

@ -1,16 +1,16 @@
#[derive(Default)] #[derive(Default)]
pub struct ListCommand { pub struct ListCommand {
uuids: bool uuids: Option<bool>
} }
impl ListCommand { impl ListCommand {
pub fn uuids(mut self) -> Self { pub fn uuids(mut self) -> Self {
self.uuids = true; self.uuids = Some(true);
self self
} }
pub fn build(self) -> super::Command { pub fn build(self) -> super::Command {
let uuids = self.uuids; let uuids = self.uuids.unwrap_or(false);
let mut s = format!("list"); let mut s = format!("list");
if uuids { if uuids {
s.push_str(" uuids"); s.push_str(" uuids");