aboutsummaryrefslogtreecommitdiff
path: root/src/format.nim
diff options
context:
space:
mode:
authorkitsunyan2018-04-29 21:01:25 +0000
committerkitsunyan2018-04-29 21:01:25 +0000
commit5f7f4f2d713025f05cbc240323b6fe47bb6dbe24 (patch)
treec67d82e2a19f101f6815fdb20bc97cf3e825076a /src/format.nim
parent10e4e09cfc70730c1206e420d9bb337d37939b30 (diff)
Add PKGBUILD retrieving
Diffstat (limited to 'src/format.nim')
-rw-r--r--src/format.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/format.nim b/src/format.nim
index c3a7e5e..bb5ae1f 100644
--- a/src/format.nim
+++ b/src/format.nim
@@ -65,6 +65,12 @@ proc printError*(color: bool, s: string) =
proc printWarning*(color: bool, s: string) =
stderr.writeLine(^Color.yellow, trp"warning: ", ^Color.normal, s)
+proc printFile*(color: bool, quiet: bool, name: string, file: string) =
+ if quiet:
+ echo(file)
+ else:
+ echo(^Color.bold, name, ^Color.normal, ' ', file)
+
proc formatPkgRating*(votes: int, popularity: float): string =
$votes & " / " & formatFloat(popularity, format = ffDecimal, precision = 6)