Add support for a bookmarks-only mode (#716)
* Add support for bookmarks-only mode * Add error for missing bookmarks in bookmarks-only mode * Error when settings url or connect backend together with bookmarks-only * Add tests for parsing options
This commit is contained in:
committed by
GitHub
parent
605c483d5b
commit
f4e7643e22
@@ -80,4 +80,18 @@ func TestParseOptions(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "../../data/passfile", opts.Passfile)
|
||||
})
|
||||
|
||||
t.Run("bookmarks only mode", func(t *testing.T) {
|
||||
_, err := ParseOptions([]string{"--bookmarks-only"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = ParseOptions([]string{"--bookmarks-only", "--url", "test"})
|
||||
assert.EqualError(t, err, "--url not supported in bookmarks-only mode")
|
||||
|
||||
_, err = ParseOptions([]string{"--bookmarks-only", "--host", "test", "--port", "5432"})
|
||||
assert.EqualError(t, err, "--host not supported in bookmarks-only mode")
|
||||
|
||||
_, err = ParseOptions([]string{"--bookmarks-only", "--connect-backend", "test", "--sessions", "--connect-token", "token", "--url", "127.0.0.2"})
|
||||
assert.EqualError(t, err, "--connect-backend not supported in bookmarks-only mode")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user