From d402a3c6307cdc5bc8b03e38ef916aaf8f201931 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Fri, 14 Oct 2022 17:07:05 +0200
Subject: [PATCH] feat implement the copyable interface

---
 change.go   | 5 +++++
 settings.go | 1 +
 2 files changed, 6 insertions(+)

diff --git a/change.go b/change.go
index 18c63d9..670c4b4 100644
--- a/change.go
+++ b/change.go
@@ -74,3 +74,8 @@ func (s *Settings[C]) setConfigInternal(config C, lock bool) *Settings[C] {
 func (s *Settings[C]) SetConfig(config C) *Settings[C] {
 	return s.setConfigInternal(config, true)
 }
+
+// Copy implements the xflags.Copyable interface.
+func (s *Settings[C]) Copy(config C) {
+	s.setConfigInternal(config, true)
+}
diff --git a/settings.go b/settings.go
index 118d9db..ff35067 100644
--- a/settings.go
+++ b/settings.go
@@ -18,6 +18,7 @@ type fileWatch struct {
 	onWatch     bool
 }
 
+// Settings is the main struct for the configuration
 type Settings[C any] struct {
 	files  fileBackend
 	stream streamBackend
-- 
GitLab