Skip to content

Commit 88fcedb

Browse files
add support for windows only flag exclude-cloud-files (#500)
1 parent a973e36 commit 88fcedb

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

restic/commands_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ func TestBuiltInCommandsTable(t *testing.T) {
563563
assert.GreaterOrEqual(t, len(GetDefaultOptions()), len(expectedOptions))
564564
})
565565

566-
t.Run("windows specific option", func(t *testing.T) {
566+
t.Run("windows specific option use-fs-snapshot", func(t *testing.T) {
567567
cmd, _ := GetCommandForVersion("backup", "0.12", false)
568568
require.NotNil(t, cmd)
569569
option, found := cmd.Lookup("use-fs-snapshot")
@@ -573,4 +573,15 @@ func TestBuiltInCommandsTable(t *testing.T) {
573573
assert.False(t, option.AvailableInOS("darwin"))
574574
assert.True(t, option.AvailableInOS("windows"))
575575
})
576+
577+
t.Run("windows specific option exclude-cloud-files", func(t *testing.T) {
578+
cmd, _ := GetCommandForVersion("backup", "0.18", false)
579+
require.NotNil(t, cmd)
580+
option, found := cmd.Lookup("exclude-cloud-files")
581+
require.True(t, found)
582+
583+
assert.False(t, option.AvailableInOS("linux"))
584+
assert.False(t, option.AvailableInOS("darwin"))
585+
assert.True(t, option.AvailableInOS("windows"))
586+
})
576587
}

restic/commands_windows.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
"Once": true,
99
"FromVersion": "0.12.0",
1010
"RemovedInVersion": ""
11+
},
12+
{
13+
"Name": "exclude-cloud-files",
14+
"Alias": "",
15+
"Default": "false",
16+
"Description": "excludes online-only cloud files (such as OneDrive Files On-Demand)",
17+
"Once": true,
18+
"FromVersion": "0.18.0",
19+
"RemovedInVersion": ""
1120
}
1221
]
1322
}

0 commit comments

Comments
 (0)