Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.

added global appendable Flags (#12) - #26

Open
root360-AndreasUlm wants to merge 5 commits into
go-gitea:masterfrom
root360-AndreasUlm:12_global_cli_flags
Open

added global appendable Flags (#12)#26
root360-AndreasUlm wants to merge 5 commits into
go-gitea:masterfrom
root360-AndreasUlm:12_global_cli_flags

Conversation

@root360-AndreasUlm

Copy link
Copy Markdown
Contributor

PR to discuss global flag options.

Signed-off-by: Andreas Ulm andreas.ulm@root360.de

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
@root360-AndreasUlm root360-AndreasUlm changed the title added global appendable Flags (#12) [WIP] added global appendable Flags (#12) May 2, 2019
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
@root360-AndreasUlm root360-AndreasUlm changed the title [WIP] added global appendable Flags (#12) added global appendable Flags (#12) May 3, 2019
Comment thread cmd/flags.go
@zeripath

zeripath commented May 5, 2019

Copy link
Copy Markdown

You might want to take a look at the way I've done it in the main Gitea binary. I'm not certain that the technique used there is definitely applicable but it shows a way of doing global options without referencing multiple files.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
@root360-AndreasUlm

Copy link
Copy Markdown
Contributor Author

You might want to take a look at the way I've done it in the main Gitea binary. I'm not certain that the technique used there is definitely applicable but it shows a way of doing global options without referencing multiple files.

This technique (https://github.com/go-gitea/gitea/blob/master/main.go#L97) does not work for tea as there are no flags that are required for all commands. The mostly used flags are --login, --output and --repo but those are not used by the subcommands login and logout. That's why I think this technique is not suited for tea.

@zeripath

zeripath commented May 5, 2019

Copy link
Copy Markdown

Fair enough. I'm not particularly au fait with how tea does things but saw what you were doing looked slightly similar.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
@root360-AndreasUlm

Copy link
Copy Markdown
Contributor Author

This PR can IMHO be merged now as I'm done with the implementation.
After merging it I'll rebase and update #25 and #13.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants