MCPcopy
hub / github.com/larksuite/cli / newGroupTree

Function newGroupTree

cmd/unknown_subcommand_test.go:19–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17)
18
19func newGroupTree() (root, drive, files *cobra.Command) {
20 root = &cobra.Command{Use: "lark-cli"}
21 drive = &cobra.Command{Use: "drive", Short: "drive ops"}
22 root.AddCommand(drive)
23
24 search := &cobra.Command{Use: "+search", RunE: func(*cobra.Command, []string) error { return nil }}
25 upload := &cobra.Command{Use: "+upload", RunE: func(*cobra.Command, []string) error { return nil }}
26 hidden := &cobra.Command{Use: "+secret", Hidden: true, RunE: func(*cobra.Command, []string) error { return nil }}
27 drive.AddCommand(search, upload, hidden)
28
29 files = &cobra.Command{Use: "files", Short: "files ops"}
30 drive.AddCommand(files)
31 files.AddCommand(&cobra.Command{Use: "list", RunE: func(*cobra.Command, []string) error { return nil }})
32
33 return root, drive, files
34}
35
36func TestInstallUnknownSubcommandGuard_InstallsOnGroupsOnly(t *testing.T) {
37 root, drive, files := newGroupTree()

Calls

no outgoing calls

Tested by

no test coverage detected