Cobra refactor#2
Conversation
Cobra viper refactor
Andrew-Kulpa
left a comment
There was a problem hiding this comment.
I love how this is turning out! I have some initial feedback on the subcommand structure and I noticed there are a lot of cobra auto-generated artifacts in the code.
| if fileFlag == false { | ||
| fmt.Println(string(internal.GetClickUpTask(taskID, token, clientID))) | ||
| return | ||
| } else { | ||
| filenm := "clickup_" + taskID + ".json" | ||
| data := internal.GetClickUpTask(taskID, token, clientID) | ||
| err := os.WriteFile(filenm, data, 0644) | ||
| if err != nil { | ||
| fmt.Println("Error writing task JSON") | ||
| } | ||
| } |
There was a problem hiding this comment.
Why not just print to STDOUT and let the user redirect that output if they want to?
There was a problem hiding this comment.
STDOUT is the primary workflow, this is just an option to generate a standard file.
|
|
||
| // logoutCmd represents the logout command | ||
| var logoutCmd = &cobra.Command{ | ||
| Use: "logout", |
There was a problem hiding this comment.
If you go forward with a clickup auth login this could just become clickup auth logout.
…ated GetToken function name
|
Alright, I think I'm down to just 2 outstanding items:
There is not a lot of real data to GET in things other than tasks. The other GET functions really just provide metadata about a list, or a teamspace, etc., not any actual data. The important piece for GET will ensuring a clear distinction between doing a single task request and a bulk task request based on some field criteria (Not proposing --bulktasks here, just using for illustration). |
|
• Resolved bug with ~/.clickup/config.yaml file not creating properly. |
No description provided.