akamensky / argparse

Argparse for golang. Just because `flag` sucks
MIT License
604 stars 62 forks source link

Gocyclo on issue 1#2 #55

Closed goofinator closed 4 years ago

goofinator commented 4 years ago

Some changes to decrease cyclomatic complexities of some functions. In most cases, it's just a decomposition on sub functions.

Some tests in argparse_test.go refactored to work through the cycles instead of simple text repeatation.

Processing of Default values (argument.go/setDefault) uses reflection, so all cases except of os.File cases, merged in one case block.