changeset 3:3cd182bff992

Show warning messages in put output
author Guido Berhoerster <guido+sievemgr@berhoerster.name>
date Tue, 27 Oct 2020 17:54:58 +0100
parents 6db34a5344b8
children f925f15d8ce5
files cmd/sievemgr/put.go go.mod go.sum
diffstat 3 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cmd/sievemgr/put.go	Mon Oct 26 15:32:20 2020 +0100
+++ b/cmd/sievemgr/put.go	Tue Oct 27 17:54:58 2020 +0100
@@ -85,8 +85,10 @@
 	}
 	defer c.Logout()
 
-	if err := c.PutScript(scriptName, script); err != nil {
+	if warnings, err := c.PutScript(scriptName, script); err != nil {
 		return err
+	} else if warnings != "" {
+		fmt.Fprintln(os.Stderr, warnings)
 	}
 
 	return nil
--- a/go.mod	Mon Oct 26 15:32:20 2020 +0100
+++ b/go.mod	Tue Oct 27 17:54:58 2020 +0100
@@ -3,6 +3,6 @@
 go 1.14
 
 require (
-	go.guido-berhoerster.org/managesieve v0.0.0-20201026142443-8413916df2be
+	go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447
 	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
 )
--- a/go.sum	Mon Oct 26 15:32:20 2020 +0100
+++ b/go.sum	Tue Oct 27 17:54:58 2020 +0100
@@ -2,6 +2,8 @@
 go.guido-berhoerster.org/managesieve v0.0.0-20201026131555-3fe1614de42c/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
 go.guido-berhoerster.org/managesieve v0.0.0-20201026142443-8413916df2be h1:pKZGpXqtVG/1d16ZzVMYzjXV09q1jPU+6BsdvVVVqZU=
 go.guido-berhoerster.org/managesieve v0.0.0-20201026142443-8413916df2be/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
+go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447 h1:VdMnQ1Nq0N6cY/ViKe1v0gUURhyWCN2WgCPJfnz6c9Y=
+go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=