Share the interspersed flag parser between subenum and wordlist-gen
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
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
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
- Move the two functions into a small package, for example
internal/cliargs, ascliargs.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 (seemain_test.goandtools/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
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TMHSDigital/subenum
-
community documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
TMHSDigital/subenum#135 ·
Maintainers usually reply within 1 day
-
area: dns enhancement good first issue
Difficulty 2/5 Under an hour Newbie friendliness 90/100
TMHSDigital/subenum#134 ·
Maintainers usually reply within 1 day
-
community marketing priority: low
Difficulty 5/5 Over a week Newbie friendliness 35/100
TMHSDigital/subenum#132 · 1 comment ·
Maintainers usually reply within 1 day
-
feature priority: low
Difficulty 5/5 Over a week Newbie friendliness 35/100
TMHSDigital/subenum#131 ·
Maintainers usually reply within 1 day
-
documentation marketing priority: medium
Difficulty 5/5 Over a week Newbie friendliness 25/100
TMHSDigital/subenum#127 ·
Maintainers usually reply within 1 day
All issues in TMHSDigital/subenum
Similar issues
-
automation models
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Bug pulumi/pulumi
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 74/100
GoogleCloudPlatform/cluster-toolkit#6437 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
stripe/stripe-cli#2130 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kovidgoyal/kitty#10625 ·
Maintainers usually reply within 1 day