MCPcopy Index your code
hub / github.com/dnote/dnote / NewCmd

Function NewCmd

pkg/cli/cmd/add/add.go:61–75  ·  view source on GitHub ↗

NewCmd returns a new add command

(ctx context.DnoteCtx)

Source from the content-addressed store, hash-verified

59
60// NewCmd returns a new add command
61func NewCmd(ctx context.DnoteCtx) *cobra.Command {
62 cmd := &cobra.Command{
63 Use: "add <book>",
64 Short: "Add a new note",
65 Aliases: []string{"a", "n", "new"},
66 Example: example,
67 PreRunE: preRun,
68 RunE: newRun(ctx),
69 }
70
71 f := cmd.Flags()
72 f.StringVarP(&contentFlag, "content", "c", "", "The new content for the note")
73
74 return cmd
75}
76
77func getContent(ctx context.DnoteCtx) (string, error) {
78 if contentFlag != "" {

Callers 1

mainFunction · 0.92

Calls 1

newRunFunction · 0.70

Tested by

no test coverage detected