Skip to content

Commit 5b348d5

Browse files
author
codevalve
committed
feat: MCP integration and version bump to v3.0.0
1 parent 49ba087 commit 5b348d5

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

cmd/root.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/spf13/cobra"
1111
)
1212

13-
var Version = "2.7.2"
13+
var Version = "3.0.0"
1414

1515
var successStyle = lipgloss.NewStyle().
1616
Bold(true).
@@ -26,10 +26,20 @@ Syntax: rapide [margin-key] | [bullet] content
2626
Example: rapide work | - Martin updated git repo`,
2727
Args: cobra.MinimumNArgs(1),
2828
Run: func(cmd *cobra.Command, args []string) {
29-
// Default action is to add an entry
30-
if args[0] == "list" {
31-
// This will be handled by the list subcommand
32-
return
29+
// If the first argument is a registered subcommand, let it handle the execution.
30+
// Cobra usually does this automatically, but since we have a greedy Run function
31+
// on the root command, we need to be careful not to consume subcommands.
32+
if len(args) > 0 {
33+
for _, sub := range cmd.Commands() {
34+
if sub.Name() == args[0] {
35+
// Found a subcommand match, this Run shouldn't have been called
36+
// Or we can manually execute it if needed, but usually we just return
37+
// and let Cobra handle it if Run was NOT defined.
38+
// However, since Run IS defined, it takes precedence.
39+
sub.Run(sub, args[1:])
40+
return
41+
}
42+
}
3343
}
3444

3545
s, err := storage.NewStorage()

0 commit comments

Comments
 (0)