blob: 31a39f596ca98ef4cae57289d5df450c1f19fe40 (
plain)
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
37
38
39
40
|
package cmd
import (
"os"
"codeberg.org/snonux/gitsyncer/internal/cli"
"github.com/spf13/cobra"
)
var listCmd = &cobra.Command{
Use: "list",
Short: "List organizations and repositories",
Long: `Display configured organizations and repositories from the configuration file.`,
}
var listOrgsCmd = &cobra.Command{
Use: "orgs",
Short: "List configured organizations",
Example: ` # List all configured organizations
gitsyncer list orgs`,
Run: func(cmd *cobra.Command, args []string) {
os.Exit(cli.HandleListOrgs(cfg))
},
}
var listReposCmd = &cobra.Command{
Use: "repos",
Short: "List configured repositories",
Example: ` # List all configured repositories
gitsyncer list repos`,
Run: func(cmd *cobra.Command, args []string) {
os.Exit(cli.HandleListRepos(cfg))
},
}
func init() {
rootCmd.AddCommand(listCmd)
listCmd.AddCommand(listOrgsCmd)
listCmd.AddCommand(listReposCmd)
}
|