• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb / mongodb-atlas-cli / 25848964073

14 May 2026 07:59AM UTC coverage: 22.479% (-41.3%) from 63.771%
25848964073

push

github

web-flow
build(deps): bump test-summary/action from 2.4 to 2.6 (#4576)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

8987 of 39979 relevant lines covered (22.48%)

0.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

15.0
/internal/cli/plugin/list.go
1
// Copyright 2024 MongoDB Inc
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package plugin
16

17
import (
18
        "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
19
        "github.com/spf13/cobra"
20
)
21

22
type ListOps struct {
23
        cli.OutputOpts
24
        Opts
25
}
26

27
func (opts *ListOps) Run() error {
1✔
28
        return opts.Print(opts.plugins.GetValidAndInvalidPlugins())
1✔
29
}
1✔
30

31
const listTemplate = `NAME        DESCRIPTION        VERSION COMMANDS {{range valueOrEmptySlice .}}
32
{{.Name}}        {{.Description}}        {{.Version}}        {{- range $i, $cmd := .Commands}}{{if $i}}
33
                        {{else}}        {{end}}{{$cmd.Name}}{{formatAliases $cmd.Aliases}}{{end}}
34
                {{end}}
35
`
36

37
func ListBuilder(pluginOpts *Opts) *cobra.Command {
×
38
        opts := &ListOps{}
×
39
        opts.Opts = *pluginOpts
×
40

×
41
        const use = "list"
×
42
        cmd := &cobra.Command{
×
43
                Use:     use,
×
44
                Aliases: cli.GenerateAliases(use),
×
45
                Short:   "Returns a list of all installed plugins.",
×
46
                PreRun: func(cmd *cobra.Command, _ []string) {
×
47
                        opts.OutWriter = cmd.OutOrStdout()
×
48
                        opts.Template = listTemplate
×
49
                },
×
50
                RunE: func(_ *cobra.Command, _ []string) error {
×
51
                        return opts.Run()
×
52
                },
×
53
        }
54

55
        return cmd
×
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc