Skip to content

Commit 77a3b55

Browse files
cli: Fix zsh completion panic from cross-struct conflict references
DownloadOnlyOpts is flattened into both UpgradeOpts and SwitchOpts, but its conflicts_with_all referenced "check", which only exists in UpgradeOpts. clap_complete panics when generating zsh completions if a conflict references an arg unknown to the command. Move the "check" conflicts to UpgradeOpts -> check and keep only the valid conflicts in DownloadOnlyOpts. Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent 0e72bc0 commit 77a3b55

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/lib/src/cli.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ pub(crate) struct DownloadOnlyOpts {
9191
/// Download the image and ensure it's retained on disk for the lifetime of this system boot,
9292
/// but it will not be applied on reboot. If the system is rebooted without applying the update,
9393
/// the image will be eligible for garbage collection again.
94-
#[clap(long, conflicts_with_all = ["check", "apply"])]
94+
#[clap(long, conflicts_with = "apply")]
9595
pub(crate) download_only: bool,
9696

9797
/// Apply a staged deployment that was previously downloaded with --download-only.
9898
///
9999
/// This unlocks the staged deployment without fetching updates from the container image source.
100100
/// The deployment will be applied on the next shutdown or reboot. Use with --apply to
101101
/// reboot immediately.
102-
#[clap(long, conflicts_with_all = ["check", "download_only"])]
102+
#[clap(long, conflicts_with = "download_only")]
103103
pub(crate) from_downloaded: bool,
104104
}
105105

@@ -113,7 +113,7 @@ pub(crate) struct UpgradeOpts {
113113
/// Check if an update is available without applying it.
114114
///
115115
/// This only downloads updated metadata, not the full image layers.
116-
#[clap(long, conflicts_with = "apply")]
116+
#[clap(long, conflicts_with_all = ["apply", "download_only", "from_downloaded"])]
117117
pub(crate) check: bool,
118118

119119
/// Restart or reboot into the new target image.

0 commit comments

Comments
 (0)