-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
36 lines (30 loc) · 731 Bytes
/
Copy pathmain.go
File metadata and controls
36 lines (30 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fmt"
"os"
"github.com/jhoffmann/bookmark-manager/cmd"
"github.com/spf13/cobra"
)
func main() {
// Get subcommands
addCmd := cmd.GetAddCmd()
listCmd := cmd.GetListCmd()
exportCmd := cmd.GetExportCmd()
rootCmd := &cobra.Command{
Use: "bookmark-manager",
Short: "A beautiful TUI bookmark manager for folders",
Run: func(rootCmd *cobra.Command, args []string) {
// Default to list command when no subcommands
listCmd.Run(rootCmd, args)
},
}
// Add subcommands
rootCmd.AddCommand(addCmd)
rootCmd.AddCommand(listCmd)
rootCmd.AddCommand(exportCmd)
// Execute root command
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}