Skip to content

Commit 5317536

Browse files
authored
Fix: image list align with other commands when use format should ignore quiet (apple#1553)
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
1 parent 16f5fc7 commit 5317536

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Sources/ContainerCommands/Image/ImageList.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension Application {
4646

4747
public mutating func run() async throws {
4848
let containerSystemConfig: ContainerSystemConfig = try await ConfigurationLoader.load()
49-
try Self.validate(format: format, quiet: quiet, verbose: verbose)
49+
try Self.validate(quiet: quiet, verbose: verbose)
5050

5151
var images = try await ClientImage.list().filter { img in
5252
!Utility.isInfraImage(name: img.reference, builderImage: containerSystemConfig.build.image, initImage: containerSystemConfig.vminit.image)
@@ -76,14 +76,10 @@ extension Application {
7676
Output.emit(Output.renderTable(items))
7777
}
7878

79-
private static func validate(format: ListFormat, quiet: Bool, verbose: Bool) throws {
79+
private static func validate(quiet: Bool, verbose: Bool) throws {
8080
if quiet && verbose {
8181
throw ContainerizationError(.invalidArgument, message: "cannot use flag --quiet and --verbose together")
8282
}
83-
let modifier = quiet || verbose
84-
if modifier && format == .json {
85-
throw ContainerizationError(.invalidArgument, message: "cannot use flag --quiet or --verbose along with --format json")
86-
}
8783
}
8884

8985
private static func emitJSON(images: [ClientImage]) async throws {

0 commit comments

Comments
 (0)