Bladeren bron

cli: proper --no-follow flag (SetTrue opt-out; the SetFalse+default combo inverted semantics and lacked the negation)

kilork 1 maand geleden
bovenliggende
commit
3d084c54e4
2 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 3 3
      src/cli.rs
  2. 2 2
      src/main.rs

+ 3 - 3
src/cli.rs

@@ -35,9 +35,9 @@ pub enum Commands {
         #[arg(long)]
         skip_before_serve: bool,
 
-        /// Follow logs after serving (use --no-follow to skip).
-        #[arg(long, action = clap::ArgAction::SetFalse, default_value_t = true)]
-        follow: bool,
+        /// Don't follow logs after serving (following is the default).
+        #[arg(long, action = clap::ArgAction::SetTrue)]
+        no_follow: bool,
 
         /// Power on cluster if switch is off (requires HA config).
         #[arg(short = 'O', long = "on")]

+ 2 - 2
src/main.rs

@@ -74,7 +74,7 @@ async fn main() -> Result<()> {
             node,
             keep,
             skip_before_serve,
-            follow,
+            no_follow,
             auto_power_on,
             sync_image,
             sync_image_source,
@@ -106,7 +106,7 @@ async fn main() -> Result<()> {
                     fit,
                     clear,
                 },
-                follow,
+                !no_follow,
                 dry_run,
             )
             .await?;