From e0cfbb764297dd45bc3857054fd993c60dcee680 Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Fri, 9 Oct 2026 08:58:28 -0500 Subject: [PATCH] fix(cli): remove doctor --fix and services --mode, which did nothing doctor --fix only hid the hint text and services --mode filtered nothing, because the server does not report service modes. Both flags are removed rather than kept as promises; doctor's summary now points at the Fix line under each failed check. services --mode can return once the server exposes service metadata (BL-065). Signed-off-by: Hector Ventura --- README.md | 1 - .../io/floci/cli/commands/DoctorCommand.java | 5 +-- .../floci/cli/commands/ServicesCommand.java | 3 -- .../io/floci/cli/unit/RemovedFlagsTest.java | 39 +++++++++++++++++++ 4 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 src/test/java/io/floci/cli/unit/RemovedFlagsTest.java diff --git a/README.md b/README.md index bd89781..266eef2 100644 --- a/README.md +++ b/README.md @@ -660,7 +660,6 @@ floci wait -o json # machine-readable output ```sh floci doctor # run all checks floci doctor --check docker.installed # run a single check by name -floci doctor --fix # auto-fix fixable issues floci doctor -o json # structured output for scripts floci gcp doctor # GCP-specific checks diff --git a/src/main/java/io/floci/cli/commands/DoctorCommand.java b/src/main/java/io/floci/cli/commands/DoctorCommand.java index be5e435..1e92fca 100644 --- a/src/main/java/io/floci/cli/commands/DoctorCommand.java +++ b/src/main/java/io/floci/cli/commands/DoctorCommand.java @@ -50,9 +50,6 @@ public class DoctorCommand implements Callable { @Option(names = {"--check"}, description = "Run only a specific check by name", paramLabel = "") String checkName; - @Option(names = {"--fix"}, description = "Attempt to auto-fix fixable issues") - boolean fix; - /** The base environment checks every product runs, in order: Docker first, then server. */ public static List dockerChecks(ProductProfile profile) { return dockerChecks(profile, new CachingDockerClient()); @@ -182,7 +179,7 @@ public class DoctorCommand implements Callable { printer.println(Ansi.green("No failures") + ", " + warns + " warning(s) to review."); } else { printer.println(fails + " issue(s) found (" + fails + " fail, " + warns + " warn)." - + (fix ? "" : " Run with --fix to auto-resolve fixable issues.")); + + " Follow the Fix line under each one."); } return fails > 0 ? 1 : 0; diff --git a/src/main/java/io/floci/cli/commands/ServicesCommand.java b/src/main/java/io/floci/cli/commands/ServicesCommand.java index 55ebae4..06f6527 100644 --- a/src/main/java/io/floci/cli/commands/ServicesCommand.java +++ b/src/main/java/io/floci/cli/commands/ServicesCommand.java @@ -35,9 +35,6 @@ public class ServicesCommand implements Callable { this.global = new GlobalOptions(profile); } - @Option(names = {"--mode"}, description = "Filter mode: docker, in-process, all (default: all)", defaultValue = "all", paramLabel = "docker|in-process|all") - String mode; - @Override public Integer call() { Printer printer = global.printer(); diff --git a/src/test/java/io/floci/cli/unit/RemovedFlagsTest.java b/src/test/java/io/floci/cli/unit/RemovedFlagsTest.java new file mode 100644 index 0000000..8c66368 --- /dev/null +++ b/src/test/java/io/floci/cli/unit/RemovedFlagsTest.java @@ -0,0 +1,39 @@ +package io.floci.cli.unit; + +import io.floci.cli.FlociCli; +import io.floci.cli.config.ProfileStore; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import picocli.CommandLine; +import picocli.CommandLine.UnmatchedArgumentException; + +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * BL-051, BL-052: doctor --fix fixed nothing and services --mode filtered nothing, so both were + * removed rather than kept as promises. They stay rejected in every product tree. + */ +class RemovedFlagsTest { + + @TempDir + Path tempDir; + + private CommandLine cli() { + return FlociCli.buildCommandLine(new ProfileStore(tempDir)); + } + + @ParameterizedTest + @ValueSource(strings = {"aws", "gcp", "az", "oci"}) + void doctorHasNoFixFlag(String product) { + assertThrows(UnmatchedArgumentException.class, () -> cli().parseArgs(product, "doctor", "--fix")); + } + + @ParameterizedTest + @ValueSource(strings = {"aws", "gcp", "az", "oci"}) + void servicesHasNoModeFlag(String product) { + assertThrows(UnmatchedArgumentException.class, () -> cli().parseArgs(product, "services", "--mode", "docker")); + } +}