aptly snapshot diff does colour output via context.progress.

This commit is contained in:
Andrey Smirnov
2014-03-06 23:34:46 +04:00
parent d5f0c576d1
commit f143277a8e
6 changed files with 59271 additions and 59268 deletions
+3 -4
View File
@@ -5,7 +5,6 @@ import (
"github.com/gonuts/commander"
"github.com/gonuts/flag"
"github.com/smira/aptly/debian"
"github.com/wsxiaoys/terminal/color"
)
func aptlySnapshotDiff(cmd *commander.Command, args []string) error {
@@ -49,9 +48,9 @@ func aptlySnapshotDiff(cmd *commander.Command, args []string) error {
}
if len(diff) == 0 {
fmt.Printf("Snapshots are identical.\n")
context.progress.Printf("Snapshots are identical.\n")
} else {
fmt.Printf(" Arch | Package | Version in A | Version in B\n")
context.progress.Printf(" Arch | Package | Version in A | Version in B\n")
for _, pdiff := range diff {
if onlyMatching && (pdiff.Left == nil || pdiff.Right == nil) {
continue
@@ -85,7 +84,7 @@ func aptlySnapshotDiff(cmd *commander.Command, args []string) error {
}
}
color.Printf(code+" %-6s | %-40s | %-40s | %-40s\n", arch, pkg, verA, verB)
context.progress.ColoredPrintf(code+" %-6s | %-40s | %-40s | %-40s", arch, pkg, verA, verB)
}
}