chore: update CLI to CLIO (#2001)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Keith Zantow
2023-08-29 15:52:26 -04:00
committed by GitHub
co-authored by Alex Goodman
parent b03e9c6868
commit 2b7a9d0be3
95 changed files with 1680 additions and 3192 deletions
+8 -5
View File
@@ -3,21 +3,24 @@ package bus
import (
"github.com/wagoodman/go-partybus"
"github.com/anchore/syft/internal/log"
"github.com/anchore/clio"
"github.com/anchore/syft/internal/redact"
"github.com/anchore/syft/syft/event"
)
func Exit() {
Publish(partybus.Event{
Type: event.CLIExit,
})
Publish(clio.ExitEvent(false))
}
func ExitWithInterrupt() {
Publish(clio.ExitEvent(true))
}
func Report(report string) {
if len(report) == 0 {
return
}
report = log.Redactor.RedactString(report)
report = redact.Apply(report)
Publish(partybus.Event{
Type: event.CLIReport,
Value: report,