From 5317536888da07f3c675fd02fcee80e84fec441a Mon Sep 17 00:00:00 2001 From: ChengHao Yang <17496418+tico88612@users.noreply.github.com> Date: Fri, 15 May 2026 16:02:07 +0800 Subject: [PATCH] Fix: image list align with other commands when use format should ignore quiet (#1553) Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com> --- Sources/ContainerCommands/Image/ImageList.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/ContainerCommands/Image/ImageList.swift b/Sources/ContainerCommands/Image/ImageList.swift index b359031b..c1f2abdb 100644 --- a/Sources/ContainerCommands/Image/ImageList.swift +++ b/Sources/ContainerCommands/Image/ImageList.swift @@ -46,7 +46,7 @@ extension Application { public mutating func run() async throws { let containerSystemConfig: ContainerSystemConfig = try await ConfigurationLoader.load() - try Self.validate(format: format, quiet: quiet, verbose: verbose) + try Self.validate(quiet: quiet, verbose: verbose) var images = try await ClientImage.list().filter { img in !Utility.isInfraImage(name: img.reference, builderImage: containerSystemConfig.build.image, initImage: containerSystemConfig.vminit.image) @@ -76,14 +76,10 @@ extension Application { Output.emit(Output.renderTable(items)) } - private static func validate(format: ListFormat, quiet: Bool, verbose: Bool) throws { + private static func validate(quiet: Bool, verbose: Bool) throws { if quiet && verbose { throw ContainerizationError(.invalidArgument, message: "cannot use flag --quiet and --verbose together") } - let modifier = quiet || verbose - if modifier && format == .json { - throw ContainerizationError(.invalidArgument, message: "cannot use flag --quiet or --verbose along with --format json") - } } private static func emitJSON(images: [ClientImage]) async throws {