mirror of
https://github.com/Threnklyn/zeit.git
synced 2026-05-18 21:03:30 +02:00
Moving Task listing from ListCmd to Task and Adding Shell Completion for Task
This commit is contained in:
@@ -105,4 +105,12 @@ func init() {
|
||||
finishCmd.Flags().StringVarP(&project, "project", "p", "", "Project to be assigned")
|
||||
finishCmd.Flags().StringVarP(¬es, "notes", "n", "", "Activity notes")
|
||||
finishCmd.Flags().StringVarP(&task, "task", "t", "", "Task to be assigned")
|
||||
|
||||
flagName := "task"
|
||||
finishCmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
user := GetCurrentUser()
|
||||
entries, _ := database.ListEntries(user)
|
||||
_, tasks := listProjectsAndTasks(entries)
|
||||
return tasks, cobra.ShellCompDirectiveDefault
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user