mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
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:
co-authored by
Alex Goodman
parent
b03e9c6868
commit
2b7a9d0be3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user