File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ go 1.24.2
5
5
toolchain go1.24.3
6
6
7
7
require (
8
- github.com/containeroo/dynflags v0.1.0
8
+ github.com/containeroo/dynflags v0.1.1
9
9
github.com/containeroo/httputils v0.0.1
10
10
github.com/containeroo/resolver v0.0.2
11
11
github.com/spf13/pflag v1.0.6
Original file line number Diff line number Diff line change 1
- github.com/containeroo/dynflags v0.1.0 h1:pWJx4rG3bznbtTDSaHQ9TpqRMPEmGX2e9D99zXP3Awg =
2
- github.com/containeroo/dynflags v0.1.0 /go.mod h1:YmSfpL9trViFWdXOz+RUXQMTFiUBkcOeVajzoh+rMVw =
1
+ github.com/containeroo/dynflags v0.1.1 h1:p6039AhBuKjfeylNwQwlQVsCEgufJDgFncrtCQmrjKE =
2
+ github.com/containeroo/dynflags v0.1.1 /go.mod h1:YmSfpL9trViFWdXOz+RUXQMTFiUBkcOeVajzoh+rMVw =
3
3
github.com/containeroo/httputils v0.0.1 h1:W9SbW6nbmnGgaEOXRH5nY9ZwLarBo3+FLUCx6EtS2mc =
4
4
github.com/containeroo/httputils v0.0.1 /go.mod h1:TrmDptapH6SBe6CeHFWY2kxy63O/9ZWBWrLKpc2SFjI =
5
5
github.com/containeroo/resolver v0.0.2 h1:xvTA1N0Nr1g37TNRt2aS3HwivhztLCC+wTgHsYccwjk =
Original file line number Diff line number Diff line change @@ -136,12 +136,16 @@ func setupDynamicFlags() *dynflags.DynFlags {
136
136
// setupUsage sets the custom usage function.
137
137
func setupUsage (fs * flag.FlagSet , df * dynflags.DynFlags ) {
138
138
fs .Usage = func () {
139
- fmt . Fprintf ( fs . Output (), "Usage: %s [FLAGS] [DYNAMIC FLAGS..] \n " , strings . ToLower ( fs .Name ())) // nolint:errcheck
139
+ out := fs .Output () // capture writer ONCE
140
140
141
- fmt .Fprintln (fs .Output (), "\n Global Flags:" ) // nolint:errcheck
141
+ fmt .Fprintf (out , "Usage: %s [FLAGS] [DYNAMIC FLAGS..]\n " , strings .ToLower (fs .Name ())) // nolint:errcheck
142
+
143
+ fmt .Fprintln (out , "\n Global Flags:" ) // nolint:errcheck
144
+ fs .SetOutput (out )
142
145
fs .PrintDefaults ()
143
146
144
- fmt .Fprintln (fs .Output (), "\n Dynamic Flags:" ) // nolint:errcheck
147
+ fmt .Fprintln (out , "\n Dynamic Flags:" ) // nolint:errcheck
148
+ df .SetOutput (out )
145
149
df .PrintDefaults ()
146
150
}
147
151
}
You can’t perform that action at this time.
0 commit comments