MCPcopy Index your code
hub / github.com/nikivdev/go / runOpenDoc

Function runOpenDoc

cli/flow/main.go:1647–1663  ·  view source on GitHub ↗
(ctx *snap.Context)

Source from the content-addressed store, hash-verified

1645}
1646
1647func runOpenDoc(ctx *snap.Context) error {
1648 if ctx.NArgs() != 1 {
1649 fmt.Fprintf(ctx.Stderr(), "Usage: %s openDoc <doc-type>\n", commandName)
1650 fmt.Fprintf(ctx.Stderr(), "Available doc types: %s\n", strings.Join(availableDocKeys(), ", "))
1651 return fmt.Errorf("expected 1 argument, got %d", ctx.NArgs())
1652 }
1653
1654 docType := ctx.Arg(0)
1655 docType = strings.TrimSpace(docType)
1656 spec, ok := resolveDocSpec(docType)
1657 if !ok {
1658 fmt.Fprintf(ctx.Stderr(), "Unknown doc type %q. Available: %s\n", docType, strings.Join(availableDocKeys(), ", "))
1659 return fmt.Errorf("unknown doc type %q", docType)
1660 }
1661
1662 return openDoc(ctx, spec)
1663}
1664
1665func runOpenChanges(ctx *snap.Context) error {
1666 if ctx.NArgs() != 0 {

Callers 1

mainFunction · 0.85

Calls 3

availableDocKeysFunction · 0.85
resolveDocSpecFunction · 0.85
openDocFunction · 0.85

Tested by

no test coverage detected