Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Share the interspersed flag parser between subenum and wordlist-gen

Open Beginner friendly
#136 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start by finding the duplicate definitions of parseInterspersed and endsWithTerminator in main.go and tools/wordlist-gen.go, plus their tests in main_test.go and tools/wordlist-gen_test.go. Create internal/cliargs exposing cliargs.Parse(fs *flag.FlagSet, args []string) ([]string, error), point both programs at it, and delete the local copies. Done when go test ./... passes with the flag-after-positional and -- terminator tests living under the new package.

Written by the indexing model from the issue text.

Description

area: cli enhancement good first issue

What

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

  1. Move the two functions into a small package, for example internal/cliargs, as cliargs.Parse(fs *flag.FlagSet, args []string) ([]string, error).
  2. Use it from both programs and delete the copies.
  3. 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.

Dominant language
Go
Stars
1
Forks
1
Avg merge
5d 2h
Merged PRs (30d)
3

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/subenum

All issues in TMHSDigital/subenum

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.