From 7e0e88a0d7687d1b6f85501158f5f5bb5f7ef822 Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sun, 7 Jan 2024 11:50:02 +0900 Subject: [PATCH] Modify behavior of outputting error messages for invalid parameters when using "GET SERVERPREFS" and "SET SERVERPREFS" command --- fmcsadmin.go | 9 ++++----- fmcsadmin_test.go | 4 ++-- release-notes.txt | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fmcsadmin.go b/fmcsadmin.go index 2237cf4..fc35fbd 100644 --- a/fmcsadmin.go +++ b/fmcsadmin.go @@ -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 { @@ -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 @@ -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 { diff --git a/fmcsadmin_test.go b/fmcsadmin_test.go index 9cc506c..2c9f18c 100644 --- a/fmcsadmin_test.go +++ b/fmcsadmin_test.go @@ -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) @@ -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) diff --git a/release-notes.txt b/release-notes.txt index 9371f82..dec1b49 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -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.