Skip to content

Conversation

alexflint
Copy link
Owner

Add Regsiter, which registers a struct containing command line arguments for inclusion in all future calls to arg.Parse or arg.MustParse. This allows you to define command line arguments per-package like this:

        package foo

        import "github.com/alexflint/go-arg"

        var args struct {
        	CacheSize int `arg:"--foo-cache-size"`
        }

        func init() {
        	args.Register(&argsFoo)
        }

Thanks jcarr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant