Draft
Conversation
anbraten
reviewed
Aug 25, 2023
qwerty287
reviewed
Aug 25, 2023
Comment on lines
+17
to
+21
| Flags: []cli.Flag{&cli.StringFlag{ | ||
| Name: "home", | ||
| Usage: "Change home directory", | ||
| EnvVars: []string{"PLUGIN_HOME"}, | ||
| }}, |
Contributor
There was a problem hiding this comment.
Isn't this already added because you have the app.Flags = globalFlags statement which adds the flags globally?
Member
Author
There was a problem hiding this comment.
need to test ... but as it's mostly used only internally I dont think we do need it anyway ...
Contributor
There was a problem hiding this comment.
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))
}
Contributor
There was a problem hiding this comment.
That means just apply this:
Suggested change
| Flags: []cli.Flag{&cli.StringFlag{ | |
| Name: "home", | |
| Usage: "Change home directory", | |
| EnvVars: []string{"PLUGIN_HOME"}, | |
| }}, |
Member
Author
There was a problem hiding this comment.
as per lable > wip till i personally do dedicate time to it or it gets priorised at work ...
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
Merged
Member
Author
|
look at https://gitea.com/gitea/tea/pulls/612 how detection works on windows |
Contributor
|
@6543 what's the state here? |
Member
Author
|
an open todo ... no time to dedicate from my site atm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #80
Sponsored by Kithara Software GmbH