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

Urfave cli v2 #571

Merged
merged 2 commits into from
Nov 12, 2019
Merged

Urfave cli v2 #571

merged 2 commits into from
Nov 12, 2019

Conversation

ffrank
Copy link
Contributor

@ffrank ffrank commented Nov 12, 2019

No description provided.

lang/gapi.go Outdated
Name: flagModulePath,
Value: "", // empty by default
Usage: "choose the modules path (absolute)",
EnvVars: []string("MGMT_MODULE_PATH"),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet you meant:

[]string{"MGMT_MODULE_PATH"},

@purpleidea
Copy link
Owner

You might also need to update something here: https://github.com/purpleidea/mgmt/blob/master/gapi/gapi.go#L104

@@ -41,207 +41,207 @@ func CLI(program, version string, flags Flags) error {
}

// All of these flags can be accessed in your GAPI implementation with
// the `c.Parent().Type` and `c.Parent().IsSet` functions. Their own
// the `c.Lineage()[1].Type` and `c.Lineage()[1].IsSet` functions. Their own
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's especially dope when you also port the comments. I do this too. Not being sarcastic. 👍

Copy link
Owner

@purpleidea purpleidea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one small issue, but otherwise looks perfect!

Could you also change the two commit prefixes:

Eg: first should be: lib: not lang, and the other should be examples: lib:

Thanks!

lang/gapi.go Outdated
// Name: "stdin",
// Usage: "use passthrough stdin",
//},
modulePath,
&modulePath,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I think you want the & up higher in the modulePath definition.

eg: modulePath := cli.StringFlag{ becomes:

modulePath := &cli.StringFlag{

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Yes, this is silly. It was one of the first places I touched and had not yet grokked this.

@purpleidea
Copy link
Owner

LGTM =D ... Waiting for travis.

PS: Did you smoke test to see if the nested GAPI stuff works?

@purpleidea purpleidea merged commit 33d89c2 into purpleidea:master Nov 12, 2019
@purpleidea
Copy link
Owner

Merged, thanks!

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.

2 participants