Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass arguments to final generator #947

Merged
merged 3 commits into from Dec 3, 2016
Merged

Pass arguments to final generator #947

merged 3 commits into from Dec 3, 2016

Conversation

jsimonetti
Copy link

This change will allow arguments to goagen which are add after the '--' argument to be passed allong to the generator.

The generate command becomes goagen gen -d --pkg-path= -- --custom-arg=value

Fixes #934

This change will allow arguments to goagen which are add after the '--' argument to be passed allong to the generator.

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
@@ -235,10 +238,10 @@ func run(pkg string, c *cobra.Command) ([]string, error) {
if err != nil {
return nil, fmt.Errorf("invalid package import path: %s", err)
}
return generate(pkgName, pkgPath, c)
return generate(pkgName, pkgPath, c, []string{})

This comment was marked as off-topic.

return nil, nil
}
}
return nil, fmt.Errorf("no flag --custom=arg found")

This comment was marked as off-topic.

@raphael
Copy link
Member

raphael commented Dec 2, 2016

Thank you, the PR looks great. Left two nitpick comments, I'll merge once you address these.

Jeroen Simonetti added 2 commits December 3, 2016 20:51
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
@raphael raphael merged commit 11a8a01 into goadesign:master Dec 3, 2016
@raphael
Copy link
Member

raphael commented Dec 3, 2016

Thank you! Do you think you could also make a PR against the v1 branch?

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.

None yet

2 participants