dedupe cli/print import (#464)

This commit is contained in:
Keepers 2022-08-02 12:40:49 -06:00 committed by GitHub
parent d7fe518007
commit a785cb5eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -7,7 +7,6 @@ import (
"github.com/alcionai/corso/cli/config" "github.com/alcionai/corso/cli/config"
"github.com/alcionai/corso/cli/options" "github.com/alcionai/corso/cli/options"
"github.com/alcionai/corso/cli/print"
. "github.com/alcionai/corso/cli/print" . "github.com/alcionai/corso/cli/print"
"github.com/alcionai/corso/cli/utils" "github.com/alcionai/corso/cli/utils"
"github.com/alcionai/corso/pkg/logger" "github.com/alcionai/corso/pkg/logger"
@ -165,8 +164,8 @@ func createExchangeCmd(cmd *cobra.Command, args []string) error {
if err != nil { if err != nil {
return errors.Wrap(err, "Unable to retrieve backup results from storage") return errors.Wrap(err, "Unable to retrieve backup results from storage")
} }
print.Backup(*bu)
OutputBackup(*bu)
return nil return nil
} }
@ -250,8 +249,7 @@ func listExchangeCmd(cmd *cobra.Command, args []string) error {
return Only(errors.Wrap(err, "Failed to list backups in the repository")) return Only(errors.Wrap(err, "Failed to list backups in the repository"))
} }
print.Backups(rps) OutputBackups(rps)
return nil return nil
} }
@ -338,7 +336,7 @@ func detailsExchangeCmd(cmd *cobra.Command, args []string) error {
return Only(errors.New("nothing to display: no items in the backup match the provided selectors")) return Only(errors.New("nothing to display: no items in the backup match the provided selectors"))
} }
print.Entries(ds.Entries) OutputEntries(ds.Entries)
return nil return nil
} }

View File

@ -111,12 +111,12 @@ func printAll(ps []Printable) {
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
// Prints the backup to the terminal with stdout. // Prints the backup to the terminal with stdout.
func Backup(b backup.Backup) { func OutputBackup(b backup.Backup) {
print(b) print(b)
} }
// Prints the backups to the terminal with stdout. // Prints the backups to the terminal with stdout.
func Backups(bs []backup.Backup) { func OutputBackups(bs []backup.Backup) {
ps := []Printable{} ps := []Printable{}
for _, b := range bs { for _, b := range bs {
ps = append(ps, b) ps = append(ps, b)
@ -125,7 +125,7 @@ func Backups(bs []backup.Backup) {
} }
// Prints the entries to the terminal with stdout. // Prints the entries to the terminal with stdout.
func Entries(des []details.DetailsEntry) { func OutputEntries(des []details.DetailsEntry) {
ps := []Printable{} ps := []Printable{}
for _, de := range des { for _, de := range des {
ps = append(ps, de) ps = append(ps, de)