MCPcopy Create free account
hub / github.com/algolia/cli / cmdWithOpts

Function cmdWithOpts

pkg/cmd/auth/get/get_test.go:32–40  ·  view source on GitHub ↗

cmdWithOpts wires runGetCmd to a custom GetOptions so tests can stub the auth seam (EnsureAuthenticated) or the dashboard client.

(opts *GetOptions)

Source from the content-addressed store, hash-verified

30// cmdWithOpts wires runGetCmd to a custom GetOptions so tests can stub the
31// auth seam (EnsureAuthenticated) or the dashboard client.
32func cmdWithOpts(opts *GetOptions) *cobra.Command {
33 cmd := &cobra.Command{
34 RunE: func(cmd *cobra.Command, args []string) error {
35 return runGetCmd(opts)
36 },
37 }
38 opts.PrintFlags.AddFlags(cmd)
39 return cmd
40}
41
42// When there's no usable session, auth get launches the login flow (here
43// stubbed) and proceeds with the resulting identity.

Calls 2

runGetCmdFunction · 0.70
AddFlagsMethod · 0.45

Tested by

no test coverage detected