MCPcopy
hub / github.com/smallstep/cli / listAction

Function listAction

command/ca/provisioner/list.go:40–63  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

38}
39
40func listAction(ctx *cli.Context) error {
41 if err := errs.NumberOfArguments(ctx, 0); err != nil {
42 return err
43 }
44
45 root := ctx.String("root")
46 caURL, err := flags.ParseCaURL(ctx)
47 if err != nil {
48 return err
49 }
50
51 provisioners, err := pki.GetProvisioners(caURL, root)
52 if err != nil {
53 return errors.Wrap(err, "error getting the provisioners")
54 }
55
56 b, err := json.MarshalIndent(provisioners, "", " ")
57 if err != nil {
58 return errors.Wrap(err, "error marshaling provisioners")
59 }
60
61 fmt.Println(string(b))
62 return nil
63}

Callers

nothing calls this directly

Calls 3

ParseCaURLFunction · 0.92
StringMethod · 0.65
GetProvisionersMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…