mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
aptly snapshot diff does colour output via context.progress.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user