added global appendable Flags (#12) #26

Closed
lunny wants to merge 4 commits from root360-AndreasUlm/12_global_cli_flags into main
Owner

Author: @root360-AndreasUlm

PR to discuss global flag options.

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

Author: @root360-AndreasUlm PR to discuss global flag options. Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
Author
Owner

Author: @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.

Author: @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.
Author
Owner

Author: @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.

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.

Author: @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. 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.
Author
Owner

Author: @zeripath

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

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

Author: @root360-AndreasUlm

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.

Author: @root360-AndreasUlm 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.
lunny added the
kind
enhancement
label 2019-06-09 13:46:22 +00:00
lunny added this to the v0.1.0 milestone 2019-06-09 13:46:27 +00:00
lunny reviewed 2019-06-22 06:58:24 +00:00
Dismissed
Author
Owner

Why not

Flags: RepoDefaultFlags
Why not ```go Flags: RepoDefaultFlags ```
lunny reviewed 2019-06-22 06:59:08 +00:00
Dismissed
Author
Owner

As above.

As above.
Author
Owner

@root360-AndreasUlm I have added some comments on code.

@root360-AndreasUlm I have added some comments on code.
Contributor

@lunny as we currently don't need any additional flag thus you are right with your comments.
Unfortunately I cannot push changes to the branch root360-AndreasUlm/12_global_cli_flags.

Shall open a new PR from my fork on gitea?

@lunny as we currently don't need any additional flag thus you are right with your comments. Unfortunately I cannot push changes to the branch root360-AndreasUlm/12_global_cli_flags. Shall open a new PR from my fork on gitea?
Author
Owner

Yes, please, I will close this one after you created a new one.

Yes, please, I will close this one after you created a new one.
Contributor

@lunny created new PR #39

@lunny created new PR https://gitea.com/gitea/tea/pulls/39
lunny closed this pull request 2019-06-23 00:48:59 +00:00
lunny removed this from the v0.1.0 milestone 2019-06-23 00:49:04 +00:00
lunny deleted branch root360-AndreasUlm/12_global_cli_flags 2019-07-01 08:25:48 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.