MCPcopy Create free account
hub / github.com/auth0/auth0-cli / showOrganizationCmd

Function showOrganizationCmd

internal/cli/organizations.go:256–299  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

254}
255
256func showOrganizationCmd(cli *cli) *cobra.Command {
257 var inputs struct {
258 ID string
259 }
260
261 cmd := &cobra.Command{
262 Use: "show",
263 Args: cobra.MaximumNArgs(1),
264 Short: "Show an organization",
265 Long: "Display information about an organization.",
266 Example: ` auth0 orgs show
267 auth0 orgs show <org-id>
268 auth0 orgs show <org-id> --json
269 auth0 orgs show <org-id> --json-compact`,
270 RunE: func(cmd *cobra.Command, args []string) error {
271 if len(args) == 0 {
272 if err := organizationID.Pick(cmd, &inputs.ID, cli.organizationPickerOptions); err != nil {
273 return err
274 }
275 } else {
276 inputs.ID = args[0]
277 }
278
279 var organization *management.Organization
280
281 if err := ansi.Waiting(func() error {
282 var err error
283 organization, err = cli.api.Organization.Read(cmd.Context(), url.PathEscape(inputs.ID))
284 return err
285 }); err != nil {
286 return fmt.Errorf("failed to read organization with ID %q: %w", inputs.ID, err)
287 }
288
289 cli.renderer.OrganizationShow(organization)
290
291 return nil
292 },
293 }
294
295 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
296 cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.")
297
298 return cmd
299}
300
301func createOrganizationCmd(cli *cli) *cobra.Command {
302 var inputs struct {

Callers 1

organizationsCmdFunction · 0.85

Calls 5

WaitingFunction · 0.92
ErrorfMethod · 0.80
OrganizationShowMethod · 0.80
ReadMethod · 0.65
PickMethod · 0.45

Tested by

no test coverage detected