tea icon indicating copy to clipboard operation
tea copied to clipboard

added global appendable Flags (#12)

Open root360-AndreasUlm opened this issue 5 years ago • 4 comments

PR to discuss global flag options.

Signed-off-by: Andreas Ulm [email protected]

root360-AndreasUlm avatar May 02 '19 05:05 root360-AndreasUlm

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.

zeripath avatar May 05 '19 07:05 zeripath

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.

root360-AndreasUlm avatar May 05 '19 13:05 root360-AndreasUlm

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

zeripath avatar May 05 '19 13:05 zeripath

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.

root360-AndreasUlm avatar May 09 '19 09:05 root360-AndreasUlm