77 "errors"
88 "flag"
99 "fmt"
10- "io"
1110 "math/rand/v2"
1211 "os"
1312 "os/signal"
@@ -189,7 +188,7 @@ func (s *session) parse() (code int, done bool) {
189188 // -tui counts only as a real flag, not as the value of another flag
190189 // (-o -tui) or an argument after "--" (#58).
191190 if f .tui {
192- return tui .Start (tuiOptions (f , fs , positionals , defaults , a . stderr )), true
191+ return tui .Start (tuiOptions (f , fs , positionals , defaults , diag )), true
193192 }
194193
195194 if f .printConfig {
@@ -209,7 +208,7 @@ func (s *session) parse() (code int, done bool) {
209208// argument and every flag the form has a field for, over SUBENUM_* and config
210209// file values. Flags the form has no field for are named in a warning, as are
211210// extra domain arguments and extra -w files (the form takes one wordlist).
212- func tuiOptions (f cliFlags , fs * flag.FlagSet , positionals []string , defaults * defaultsLoader , stderr io .Writer ) tui.Options {
211+ func tuiOptions (f cliFlags , fs * flag.FlagSet , positionals []string , defaults * defaultsLoader , diag * output .Writer ) tui.Options {
213212 settings := defaults .settings (fs )
214213 wired := map [string ]bool {}
215214 for _ , name := range tui .Flags () {
@@ -227,7 +226,7 @@ func tuiOptions(f cliFlags, fs *flag.FlagSet, positionals []string, defaults *de
227226 })
228227 if len (f .wordlists .paths ) > 1 {
229228 settings ["w" ] = f .wordlists .paths [0 ]
230- _ , _ = fmt . Fprintf ( stderr , "Warning: the TUI takes one wordlist; using %s\n " , f .wordlists .paths [0 ])
229+ diag . Notice ( "Warning: the TUI takes one wordlist; using %s" , f .wordlists .paths [0 ])
231230 }
232231 opts := tui.Options {Version : resolveVersion (), Settings : settings }
233232 if len (positionals ) > 0 {
@@ -237,7 +236,7 @@ func tuiOptions(f cliFlags, fs *flag.FlagSet, positionals []string, defaults *de
237236 ignored = append (ignored , positionals [1 :]... )
238237 }
239238 if len (ignored ) > 0 {
240- _ , _ = fmt . Fprintf ( stderr , "Warning: -tui has no form field for %s; ignored\n " , strings .Join (ignored , " " ))
239+ diag . Notice ( "Warning: -tui has no form field for %s; ignored" , strings .Join (ignored , " " ))
241240 }
242241 return opts
243242}
0 commit comments