-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add builtin netrc helper #82
base: main
Are you sure you want to change the base?
Conversation
Flags: []cli.Flag{&cli.StringFlag{ | ||
Name: "home", | ||
Usage: "Change home directory", | ||
EnvVars: []string{"PLUGIN_HOME"}, | ||
}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already added because you have the app.Flags = globalFlags
statement which adds the flags globally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to test ... but as it's mostly used only internally I dont think we do need it anyway ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this, working as I expected.
You can try with this:
package main
import (
"fmt"
"os"
"github.com/urfave/cli/v2"
)
func main() {
app := cli.NewApp()
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "testflag",
},
}
app.Commands = []*cli.Command{
&cli.Command{
Name: "cmd",
Action: func(ctx *cli.Context) error {
fmt.Println(ctx.String("testflag"))
return nil
},
},
}
fmt.Println(app.Run(os.Args))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That means just apply this:
Flags: []cli.Flag{&cli.StringFlag{ | |
Name: "home", | |
Usage: "Change home directory", | |
EnvVars: []string{"PLUGIN_HOME"}, | |
}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@6543 @qwerty287 What is the status here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per lable > wip till i personally do dedicate time to it or it gets priorised at work ...
Co-authored-by: qwerty287 <[email protected]>
Co-authored-by: Anbraten <[email protected]>
look at https://gitea.com/gitea/tea/pulls/612 how detection works on windows |
@6543 what's the state here? |
an open todo ... no time to dedicate from my site atm |
closes #80
Sponsored by Kithara Software GmbH