Skip to content

Commit

Permalink
Print size last
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Feb 3, 2023
1 parent b836429 commit 7d513de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/tart/Commands/List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import SwiftUI

fileprivate struct VMInfo: Encodable {
let Source: String
let Size: Int
let Name: String
let Size: Int
}

struct List: AsyncParsableCommand {
Expand All @@ -31,13 +31,13 @@ struct List: AsyncParsableCommand {
var infos: [VMInfo] = []
if source == nil || source == "local" {
infos += sortedInfos(try VMStorageLocal().list().map { (name, vmDir) in
try VMInfo(Source: "local", Size: vmDir.sizeGB(), Name: name)
try VMInfo(Source: "local", Name: name, Size: vmDir.sizeGB())
})
}

if source == nil || source == "oci" {
infos += sortedInfos(try VMStorageOCI().list().map { (name, vmDir, _) in
try VMInfo(Source: "oci", Size: vmDir.sizeGB(), Name: name)
try VMInfo(Source: "oci", Name: name, Size: vmDir.sizeGB())
})
}
print(format.renderList(infos))
Expand Down

0 comments on commit 7d513de

Please sign in to comment.