clean up cli outputs (#1271)

## Description

Remove old "restored..." confirmation line from the CLI. Renamed the "Reference" column header to "ID"  in the tabular output, which represents the shortRef aka item id.

## Type of change

- [x] 🐹 Trivial/Minor

## Issue(s)

* #1269

## Test Plan

- [x] 💪 Manual
- [x]  Unit test
This commit is contained in:
Keepers 2022-10-21 17:02:05 -06:00 committed by GitHub
parent 2d29258caf
commit f335fd8b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 15 deletions

View File

@ -233,11 +233,11 @@ docker run --env-file $HOME/.corso/corso.env \\
</TabItem>
</Tabs>
The output from the command above should display a list of any matching emails. Note the reference
The output from the command above should display a list of any matching emails. Note the ID
of the email you would like to use for testing restore.
```text
Reference Sender Subject Received
ID Sender Subject Received
360bf6840396 phish@contoso.info Re: Request for Apple/Amazon gift cards 2022-10-18T02:27:47Z
84dbad89b9f5 ravi@cohovineyard.com Come join us! 2022-10-19T06:12:08Z
...
@ -250,7 +250,7 @@ To restore the selected email, use the following command.
```powershell
# Restore a selected email
.\corso restore exchange --backup <id of your selected backup> --email <email reference>
.\corso restore exchange --backup <id of your selected backup> --email <email ID>
```
</TabItem>
@ -258,7 +258,7 @@ To restore the selected email, use the following command.
```bash
# Restore a selected email
./corso restore exchange --backup <id of your selected backup> --email <email reference>
./corso restore exchange --backup <id of your selected backup> --email <email ID>
```
</TabItem>
@ -268,7 +268,7 @@ To restore the selected email, use the following command.
`# Restore a selected email
docker run --env-file $HOME/.corso/corso.env \\
--volume $HOME/.corso:/app/corso ghcr.io/alcionai/corso:${Version()} \\
restore exchange --backup <id of your selected backup> --email <email reference>`
restore exchange --backup <id of your selected backup> --email <email ID>`
}</CodeBlock>
</TabItem>
@ -277,7 +277,7 @@ docker run --env-file $HOME/.corso/corso.env \\
A confirmation of the recovered email will be shown and the email will appear in a new mailbox folder named `Corso_Restore_DD-MMM-YYYY_HH:MM:SS`.
```text
Reference Sender Subject Received
ID Sender Subject Received
360bf6840396 phish@contoso.info Re: Request for Apple/Amazon gift cards 2022-10-18T02:27:47Z
```

View File

@ -237,7 +237,6 @@ func restoreExchangeCmd(cmd *cobra.Command, args []string) error {
return Only(ctx, errors.Wrap(err, "Failed to run Exchange restore"))
}
Infof(ctx, "Restored Exchange in %s for user %s.\n", s.Provider, sel.ToPrintable().Resources())
ds.PrintEntries(ctx)
return nil

View File

@ -174,7 +174,6 @@ func restoreOneDriveCmd(cmd *cobra.Command, args []string) error {
return Only(ctx, errors.Wrap(err, "Failed to run OneDrive restore"))
}
Infof(ctx, "Restored OneDrive in %s for user %s.\n", s.Provider, sel.ToPrintable().Resources())
ds.PrintEntries(ctx)
return nil

View File

@ -184,7 +184,7 @@ func (de DetailsEntry) MinimumPrintable() any {
// Headers returns the human-readable names of properties in a DetailsEntry
// for printing out to a terminal in a columnar display.
func (de DetailsEntry) Headers() []string {
hs := []string{"Reference"}
hs := []string{"ID"}
if de.ItemInfo.Folder != nil {
hs = append(hs, de.ItemInfo.Folder.Headers()...)

View File

@ -40,7 +40,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
RepoRef: "reporef",
ShortRef: "deadbeef",
},
expectHs: []string{"Reference"},
expectHs: []string{"ID"},
expectVs: []string{"deadbeef"},
},
{
@ -58,7 +58,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
},
},
},
expectHs: []string{"Reference", "Organizer", "Subject", "Starts", "Recurring"},
expectHs: []string{"ID", "Organizer", "Subject", "Starts", "Recurring"},
expectVs: []string{"deadbeef", "organizer", "subject", nowStr, "true"},
},
{
@ -73,7 +73,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
},
},
},
expectHs: []string{"Reference", "Contact Name"},
expectHs: []string{"ID", "Contact Name"},
expectVs: []string{"deadbeef", "contactName"},
},
{
@ -90,7 +90,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
},
},
},
expectHs: []string{"Reference", "Sender", "Subject", "Received"},
expectHs: []string{"ID", "Sender", "Subject", "Received"},
expectVs: []string{"deadbeef", "sender", "subject", nowStr},
},
{
@ -102,7 +102,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
Sharepoint: &details.SharepointInfo{},
},
},
expectHs: []string{"Reference"},
expectHs: []string{"ID"},
expectVs: []string{"deadbeef"},
},
{
@ -120,7 +120,7 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
},
},
},
expectHs: []string{"Reference", "ItemName", "ParentPath", "Size", "Created", "Modified"},
expectHs: []string{"ID", "ItemName", "ParentPath", "Size", "Created", "Modified"},
expectVs: []string{"deadbeef", "itemName", "parentPath", "1.0 kB", nowStr, nowStr},
},
}