File tree Expand file tree Collapse file tree 5 files changed +94
-0
lines changed Expand file tree Collapse file tree 5 files changed +94
-0
lines changed Original file line number Diff line number Diff line change 1+ * .sqlite
2+ cli-cms
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright © 2025 Dreams of Code
3+ */
4+ package cmd
5+
6+ import (
7+ "fmt"
8+
9+ "github.com/spf13/cobra"
10+ )
11+
12+ // editCmd represents the edit command
13+ var editCmd = & cobra.Command {
14+ Use : "edit" ,
15+ Short : "Used to edit a blog post" ,
16+ Run : func (cmd * cobra.Command , args []string ) {
17+ fmt .Println ("edit called" )
18+ },
19+ }
20+
21+ func init () {
22+ postsCmd .AddCommand (editCmd )
23+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright © 2025 Dreams of Code
3+ */
4+ package cmd
5+
6+ import (
7+ "fmt"
8+
9+ "github.com/spf13/cobra"
10+ )
11+
12+ // getCmd represents the get command
13+ var getCmd = & cobra.Command {
14+ Use : "get" ,
15+ Short : "Used to get a blog post by it's ID" ,
16+ Run : func (cmd * cobra.Command , args []string ) {
17+ fmt .Println ("get called" )
18+ },
19+ }
20+
21+ func init () {
22+ postsCmd .AddCommand (getCmd )
23+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright © 2025 Dreams of Code
3+ */
4+ package cmd
5+
6+ import (
7+ "fmt"
8+
9+ "github.com/spf13/cobra"
10+ )
11+
12+ // listCmd represents the list command
13+ var listCmd = & cobra.Command {
14+ Use : "list" ,
15+ Short : "Used to list the blog posts in the system" ,
16+ Run : func (cmd * cobra.Command , args []string ) {
17+ fmt .Println ("list called" )
18+ },
19+ }
20+
21+ func init () {
22+ postsCmd .AddCommand (listCmd )
23+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright © 2025 Dreams of Code
3+ */
4+ package cmd
5+
6+ import (
7+ "fmt"
8+
9+ "github.com/spf13/cobra"
10+ )
11+
12+ // removeCmd represents the remove command
13+ var removeCmd = & cobra.Command {
14+ Use : "remove" ,
15+ Short : "Used to remove a blog post by it's ID" ,
16+ Run : func (cmd * cobra.Command , args []string ) {
17+ fmt .Println ("remove called" )
18+ },
19+ }
20+
21+ func init () {
22+ postsCmd .AddCommand (removeCmd )
23+ }
You can’t perform that action at this time.
0 commit comments