You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share the interspersed flag parser between subenum and wordlist-gen #136
parseInterspersed and endsWithTerminator exist twice: in main.go and, since #133, in tools/wordlist-gen.go. Both are package main, so they could not import each other.
How
Move the two functions into a small package, for example internal/cliargs, as cliargs.Parse(fs *flag.FlagSet, args []string) ([]string, error).
Use it from both programs and delete the copies.
Move or add the tests for flags after positionals and the -- terminator (see main_test.go and tools/wordlist-gen_test.go).
Done when
One implementation, used by both programs, with its own tests; go test ./... passes.
Fixed in d6d4954: the two identical copies of parseInterspersed/endsWithTerminator in main.go and tools/wordlist-gen.go are now one cliargs.Parse in internal/cliargs (moved verbatim, so behaviour is unchanged). Verified with the existing TestParseFlagsInterspersed/TestParseFlagsInvalidAfterDomain and wordlist-gen terminator tests, new table tests in internal/cliargs (96% coverage), a new TestRunInterspersedFlags for wordlist-gen, and the full go test -race ./....
Activity
TMHSDigital commentedon Nov 10, 2026
Fixed in d6d4954: the two identical copies of
parseInterspersed/endsWithTerminatorinmain.goandtools/wordlist-gen.goare now onecliargs.Parseininternal/cliargs(moved verbatim, so behaviour is unchanged). Verified with the existingTestParseFlagsInterspersed/TestParseFlagsInvalidAfterDomainand wordlist-gen terminator tests, new table tests ininternal/cliargs(96% coverage), a newTestRunInterspersedFlagsfor wordlist-gen, and the fullgo test -race ./....refactor(cli): share the interspersed flag parser via internal/cliargs (