MCPcopy Create free account
hub / github.com/compozy/agh / commandSkillAgentFlag

Function commandSkillAgentFlag

internal/cli/skill_workspace.go:285–300  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

283}
284
285func commandSkillAgentFlag(cmd *cobra.Command) (string, error) {
286 agentName, err := cmd.Flags().GetString("for-agent")
287 if err != nil {
288 return "", fmt.Errorf("read for-agent flag: %w", err)
289 }
290 trimmed := strings.TrimSpace(agentName)
291 if cmd.Flags().Changed("for-agent") && trimmed == "" {
292 return "", fmt.Errorf("for-agent flag cannot be empty")
293 }
294 if trimmed != "" {
295 if err := aghconfig.ValidateAgentName(trimmed); err != nil {
296 return "", err
297 }
298 }
299 return trimmed, nil
300}
301
302func normalizeSkillSourceFilter(sourceFilter string) (string, error) {
303 filter := strings.ToLower(strings.TrimSpace(sourceFilter))

Callers 1

resolveSkillCommandScopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected