Skip to content

Commit 893bd0b

Browse files
committed
feat: add sub-commands os, git, github
Signed-off-by: Daniel Hu <[email protected]>
1 parent 13c8267 commit 893bd0b

File tree

10 files changed

+85
-15
lines changed

10 files changed

+85
-15
lines changed
File renamed without changes.

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
todo

cmd/git.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmd
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/git"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
// gitCmd represents the git command
9+
var gitCmd = &cobra.Command{
10+
Use: "git",
11+
Short: "git is used to execute git operations",
12+
Long: `git is used to execute git operations`,
13+
Run: func(cmd *cobra.Command, args []string) {
14+
git.Run()
15+
},
16+
}
17+
18+
func init() {
19+
rootCmd.AddCommand(gitCmd)
20+
}

cmd/github.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmd
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/github"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
// githubCmd represents the github command
9+
var githubCmd = &cobra.Command{
10+
Use: "github",
11+
Short: "github is used to execute github operations",
12+
Long: `github is used to execute github operations`,
13+
Run: func(cmd *cobra.Command, args []string) {
14+
github.Run()
15+
},
16+
}
17+
18+
func init() {
19+
rootCmd.AddCommand(githubCmd)
20+
}

cmd/os.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmd
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/osx"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
// osCmd represents the os command
9+
var osCmd = &cobra.Command{
10+
Use: "os",
11+
Short: "os is used to execute os operations",
12+
Long: `os is used to execute os operations`,
13+
Run: func(cmd *cobra.Command, args []string) {
14+
osx.Run()
15+
},
16+
}
17+
18+
func init() {
19+
rootCmd.AddCommand(osCmd)
20+
}

cmd/root.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
3-
4-
*/
51
package cmd
62

73
import (
@@ -16,17 +12,9 @@ var cfgFile string
1612

1713
// rootCmd represents the base command when called without any subcommands
1814
var rootCmd = &cobra.Command{
19-
Use: "devstream",
20-
Short: "A brief description of your application",
21-
Long: `A longer description that spans multiple lines and likely contains
22-
examples and usage of using your application. For example:
23-
24-
Cobra is a CLI library for Go that empowers applications.
25-
This application is a tool to generate the needed files
26-
to quickly create a Cobra application.`,
27-
// Uncomment the following line if your bare application
28-
// has an action associated with it:
29-
// Run: func(cmd *cobra.Command, args []string) { },
15+
Use: "dtm",
16+
Short: "dtm is a tool to manage variaties of development platforms",
17+
Long: `dtm is a tool to manage variaties of development platforms.`,
3018
}
3119

3220
// Execute adds all child commands to the root command and sets flags appropriately.

devstream

7.69 MB
Binary file not shown.

internal/pkg/git/git.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package git
2+
3+
import "fmt"
4+
5+
func Run() {
6+
fmt.Println("git called")
7+
}

internal/pkg/github/github.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package github
2+
3+
import "fmt"
4+
5+
func Run() {
6+
fmt.Println("github called")
7+
}

internal/pkg/osx/os.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package osx
2+
3+
import "fmt"
4+
5+
func Run() {
6+
fmt.Println("os called")
7+
}

0 commit comments

Comments
 (0)