fix(cli): keep the next step when an error's cause has several lines (#67)

A failed docker run with more than one line of output lost its 'floci doctor' hint, and a profile or Compose file that does not parse was reported with the parser's source-location line instead of what to do. Causes are now shown as one line, and docker's own output always gets its next step.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-10-11 21:17:28 -05:00
1 parent 68d28d49ef
commit 188aa23edc
13 files changed
+149 -28

No files matched your search

@@ -2,6 +2,7 @@ package io.floci.cli.config;
import io.floci.cli.output.Ansi;
import io.floci.cli.output.OutputFormat;
import io.floci.cli.util.Causes;
import picocli.CommandLine;
import picocli.CommandLine.IDefaultValueProvider;
import picocli.CommandLine.Model.ArgSpec;
@@ -117,7 +118,7 @@ public class ProfileDefaultValueProvider implements IDefaultValueProvider {
} catch (IllegalArgumentException e) {
throw new ProfileNotFoundException(commandLine, e.getMessage());
} catch (IOException e) {
throw invalid(commandLine, name, e.getMessage());
throw invalid(commandLine, name, Causes.firstLine(e));
}
if (loaded.isEmpty()) {
throw new ProfileNotFoundException(commandLine,