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

added global appendable Flags (#12) #26

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

root360-AndreasUlm
Copy link
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
cmd/flags.go Show resolved Hide resolved
@zeripath
Copy link

zeripath commented May 5, 2019

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
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
Copy link

zeripath commented May 5, 2019

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