Skip to content

Commit

Permalink
Reverted quiet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Feb 3, 2023
1 parent 7d513de commit f1dbe3e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/tart/Commands/List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ struct List: AsyncParsableCommand {
@Option(help: "Output format")
var format: Format = .text

@Flag(name: [.short, .long], help: ArgumentHelp("Only display VM names."))
var quiet: Bool = false

func validate() throws {
guard let source = source else {
return
Expand All @@ -40,7 +43,13 @@ struct List: AsyncParsableCommand {
try VMInfo(Source: "oci", Name: name, Size: vmDir.sizeGB())
})
}
print(format.renderList(infos))
if (quiet) {
for info in infos {
print(info.Name)
}
} else {
print(format.renderList(infos))
}
}

private func sortedInfos(_ infos: [VMInfo]) -> [VMInfo] {
Expand Down

0 comments on commit f1dbe3e

Please sign in to comment.