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

Function resolveVerifyTaskID

apps/cli/internal/cli/verify.go:70–88  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

68}
69
70func resolveVerifyTaskID(args []string) (string, error) {
71 positional := ""
72 if len(args) > 0 {
73 positional = args[0]
74 }
75 flagVal := verifyTaskID
76
77 if positional != "" && flagVal != "" && positional != flagVal {
78 return "", fmt.Errorf("conflicting task ID: positional argument %q and --task-id %q differ", positional, flagVal)
79 }
80
81 if positional != "" {
82 return positional, nil
83 }
84 if flagVal != "" {
85 return flagVal, nil
86 }
87 return "", fmt.Errorf("task ID required: provide as positional argument or --task-id flag")
88}
89
90func runVerify(cmd *cobra.Command, args []string) error {
91 taskID, err := resolveVerifyTaskID(args)

Callers 1

runVerifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected