Skip to content

Commit 8c1f16e

Browse files
committed
values are now aligned
1 parent 8f77ce3 commit 8c1f16e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

diskspace/main.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ArgumentParser
1313

1414
struct DiskSpace : ParsableCommand {
1515
@Flag(name: [.customShort("H"), .long],
16-
help: "'Human-readable' output using unit suffixes")
16+
help: "Human readable output using unit suffixes")
1717
var humanReadable = false
1818

1919
@Flag(name: .shortAndLong,
@@ -32,7 +32,7 @@ struct DiskSpace : ParsableCommand {
3232
help: "Print only the value of the total Capacity")
3333
var total = false
3434

35-
@Argument var volumePath = "/"
35+
@Argument(help: "path to the volume") var volumePath = "/"
3636

3737
func printValue(value int: Int, label: String? = nil) {
3838
printValue(value: Int64(int), label: label)
@@ -48,7 +48,8 @@ struct DiskSpace : ParsableCommand {
4848
}
4949

5050
if let label = label {
51-
print("\(label): \(value)")
51+
let paddedLabel = "\(label):".padding(toLength: 15, withPad: " ", startingAt: 0)
52+
print("\(paddedLabel) \(value)")
5253
} else {
5354
print(value)
5455
}

0 commit comments

Comments
 (0)