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

Add builtin netrc helper #82

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

6543
Copy link
Member

@6543 6543 commented Aug 24, 2023

closes #80


Sponsored by Kithara Software GmbH

@6543 6543 changed the title WIP: Add builtin netrc helper Add builtin netrc helper Aug 24, 2023
@6543 6543 marked this pull request as ready for review August 24, 2023 18:04
@6543 6543 added the feature label Aug 24, 2023
plugin.go Outdated Show resolved Hide resolved
netrc.go Outdated Show resolved Hide resolved
Comment on lines +17 to +21
Flags: []cli.Flag{&cli.StringFlag{
Name: "home",
Usage: "Change home directory",
EnvVars: []string{"PLUGIN_HOME"},
}},
Copy link
Contributor

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?

Copy link
Member Author

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 ...

Copy link
Contributor

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))
}

Copy link
Contributor

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:

Suggested change
Flags: []cli.Flag{&cli.StringFlag{
Name: "home",
Usage: "Change home directory",
EnvVars: []string{"PLUGIN_HOME"},
}},

Copy link
Contributor

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?

Copy link
Member Author

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 ...

netrc.go Outdated Show resolved Hide resolved
@6543 6543 added the wip label Sep 30, 2023
@qwerty287 qwerty287 mentioned this pull request Oct 14, 2023
@6543
Copy link
Member Author

6543 commented Aug 26, 2024

look at https://gitea.com/gitea/tea/pulls/612 how detection works on windows

@qwerty287
Copy link
Contributor

@6543 what's the state here?

@6543
Copy link
Member Author

6543 commented Nov 2, 2024

an open todo ... no time to dedicate from my site atm

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

Successfully merging this pull request may close these issues.

add builtin netrc helper
4 participants