Skip to content

Commit

Permalink
Modify behavior of outputting error messages for invalid parameters w…
Browse files Browse the repository at this point in the history
…hen using "GET SERVERPREFS" and "SET SERVERPREFS" command
  • Loading branch information
matsuo committed Jan 7, 2024
1 parent 95c43e8 commit 7e0e88a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions fmcsadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ func (c *cli) Run(args []string) int {
case "authenticatedstream", "parallelbackupenabled":
case "persistcacheenabled", "syncpersistcache":
default:
exitStatus = 3
exitStatus = 10001
}

if exitStatus != 0 {
Expand Down Expand Up @@ -1113,7 +1113,7 @@ func (c *cli) Run(args []string) int {
case "syncpersistcache":
printOptions = append(printOptions, "syncpersistcache")
default:
exitStatus = 3
exitStatus = 10001
}
if exitStatus != 0 {
break
Expand Down Expand Up @@ -1957,12 +1957,11 @@ func (c *cli) Run(args []string) int {
switch strings.ToLower(option) {
case "cachesize", "maxfiles", "maxguests", "allowpsos", "startuprestorationenabled", "requiresecuredb":
case "authenticatedstream", "parallelbackupenabled":
//case "persistcacheenabled", "syncpersistcache":
default:
exitStatus = 3
exitStatus = 10001
}

if exitStatus == 3 {
if exitStatus == 10001 {
break
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions fmcsadmin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestRun(t *testing.T) {

args = strings.Split("fmcsadmin get serverprefs invalidparameter", " ")
status = cli.Run(args)
assert.Equal(t, 3, status)
assert.Equal(t, 10001, status)

args = strings.Split("fmcsadmin get unknown", " ")
status = cli.Run(args)
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestRun(t *testing.T) {

args = strings.Split("fmcsadmin set serverprefs invalidparameter=true", " ")
status = cli.Run(args)
assert.Equal(t, 3, status)
assert.Equal(t, 10001, status)

args = strings.Split("fmcsadmin set unknown", " ")
status = cli.Run(args)
Expand Down
1 change: 1 addition & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Version: 2.2.0 (in development)
- Add support for Ubuntu 22.04 LTS on arm64 architecture.
- Update "GET SERVERPREFS" command to get persistent cache setting for Claris FileMaker Server 2023 (20.1). (Usage: "fmcsadmin get serverprefs PersistCacheEnabled")
- Update "GET SERVERPREFS" command to get persistent cache sync setting for Claris FileMaker Server 2023 (20.1). (Usage: "fmcsadmin get serverprefs SyncPersistCache")
- Modify behavior of outputting error messages for invalid parameters when using "GET SERVERPREFS" and "SET SERVERPREFS" command.
- Add support for Windows Server 2019 and Windows Server 2022.
- Tested with Claris FileMaker Server 20.3.
- Tested on macOS Sonoma 14.
Expand Down

0 comments on commit 7e0e88a

Please sign in to comment.