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
+7 -7
View File
@@ -1,15 +1,14 @@
package integration
import (
"context"
"fmt"
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/anchore/syft/cmd/syft/cli/convert"
"github.com/anchore/syft/internal/config"
"github.com/anchore/syft/cmd/syft/cli/commands"
"github.com/anchore/syft/cmd/syft/cli/options"
"github.com/anchore/syft/syft/formats"
"github.com/anchore/syft/syft/formats/cyclonedxjson"
"github.com/anchore/syft/syft/formats/cyclonedxxml"
@@ -72,9 +71,10 @@ func TestConvertCmd(t *testing.T) {
_ = os.Remove(syftFile.Name())
}()
ctx := context.Background()
app := &config.Application{
Outputs: []string{fmt.Sprintf("%s=%s", test.format.ID().String(), formatFile.Name())},
opts := &commands.ConvertOptions{
MultiOutput: options.MultiOutput{
Outputs: []string{fmt.Sprintf("%s=%s", test.format.ID().String(), formatFile.Name())},
},
}
// stdout reduction of test noise
@@ -84,7 +84,7 @@ func TestConvertCmd(t *testing.T) {
os.Stdout = rescue
}()
err = convert.Run(ctx, app, []string{syftFile.Name()})
err = commands.RunConvert(opts, syftFile.Name())
require.NoError(t, err)
contents, err := os.ReadFile(formatFile.Name())
require.NoError(t, err)