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

Function readOptionalCommandInput

internal/cli/memory.go:1411–1430  ·  view source on GitHub ↗
(reader io.Reader)

Source from the content-addressed store, hash-verified

1409}
1410
1411func readOptionalCommandInput(reader io.Reader) (string, error) {
1412 if reader == nil {
1413 return "", nil
1414 }
1415 if file, ok := reader.(*os.File); ok {
1416 info, err := file.Stat()
1417 if err != nil {
1418 return "", fmt.Errorf("cli: stat stdin: %w", err)
1419 }
1420 if info.Mode()&os.ModeCharDevice != 0 {
1421 return "", nil
1422 }
1423 }
1424
1425 data, err := io.ReadAll(reader)
1426 if err != nil {
1427 return "", fmt.Errorf("cli: read stdin: %w", err)
1428 }
1429 return string(data), nil
1430}
1431
1432func parseMemoryPromotionSelector(
1433 deps commandDeps,

Callers 5

TestMemoryBundleHelpersFunction · 0.85
resolveToolInvokeInputFunction · 0.85
readVaultSecretStdinFunction · 0.85
resolveMemoryContentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMemoryBundleHelpersFunction · 0.68