MCPcopy Create free account
hub / github.com/driangle/taskmd / resolveSetTaskID

Function resolveSetTaskID

apps/cli/internal/cli/set.go:84–102  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

82}
83
84func resolveSetTaskID(cmd *cobra.Command, args []string) (string, error) {
85 positional := ""
86 if len(args) > 0 {
87 positional = args[0]
88 }
89 flagVal := setTaskID
90
91 if positional != "" && flagVal != "" && positional != flagVal {
92 return "", fmt.Errorf("conflicting task ID: positional argument %q and --task-id %q differ", positional, flagVal)
93 }
94
95 if positional != "" {
96 return positional, nil
97 }
98 if flagVal != "" {
99 return flagVal, nil
100 }
101 return "", fmt.Errorf("task ID required: provide as positional argument or --task-id flag")
102}
103
104func runSet(cmd *cobra.Command, args []string) error {
105 taskID, err := resolveSetTaskID(cmd, args)

Callers 1

runSetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected