// Info is part of the cmd.Command interface.
186596
func (c *RelationGetCommand) Info() *cmd.Info {
	args := "<key> <unit id>"
	doc := `
relation-get prints the value of a unit's relation setting, specified by key.
If no key is given, or if the key is "-", all keys and values will be printed.
`
	// There's nothing we can really do about the error here.
	if name, err := c.ctx.RemoteUnitName(); err == nil {
		args = "[<key> [<unit id>]]"
		doc += fmt.Sprintf("Current default unit id is %q.", name)
	} else if !errors.IsNotFound(err) {
		logger.Errorf("Failed to retrieve remote unit name: %v", err)
	}
	return jujucmd.Info(&cmd.Info{
		Name:    "relation-get",
		Args:    args,
		Purpose: "get relation settings",
		Doc:     doc,
	})
}
791983
func (a *machineAgentCmd) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "machine",
		Purpose: "run a juju machine agent",
	})
}
1302839
func (c *showMachineCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "show-machine",
		Args:    "<machineID> ...",
		Purpose: "Show a machine's status.",
		Doc:     showMachineCommandDoc,
	})
}
858897
func (c *defaultsCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Args:    "[[<cloud/>]<region> ]<model-key>[<=value>] ...]",
		Doc:     modelDefaultsHelpDoc,
		Name:    "model-defaults",
		Purpose: modelDefaultsSummary,
		Aliases: []string{"model-default"},
	})
}
793310
func (c *checkoutCommand) Info() *cmd.Info {
	info := &cmd.Info{
		Name:    "checkout",
		Args:    "<branch name>",
		Purpose: checkoutSummary,
		Doc:     checkoutDoc,
	}
	return jujucmd.Info(info)
}
948165
func (c *registerCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "register",
		Args:    "<registration string>|<controller host name>",
		Purpose: usageRegisterSummary,
		Doc:     usageRegisterDetails,
	})
}
556323
func (c *listCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "storage",
		Args:    "<filesystem|volume> ...",
		Purpose: "Lists storage details.",
		Doc:     listCommandDoc,
		Aliases: []string{"list-storage"},
	})
}
263382
func (c *configCommand) Info() *cmd.Info {
	info := &cmd.Info{
		Args:    "[<model-key>[=<value>] ...]",
		Name:    "model-config",
		Purpose: modelConfigSummary,
	}
	if details, err := c.modelConfigDetails(); err == nil {
		if output, err := formatGlobalModelConfigDetails(details); err == nil {
			info.Doc = fmt.Sprintf("%s%s\n%s%s",
				modelConfigHelpDocPartOne,
				modelConfigHelpDocKeys,
				output,
				modelConfigHelpDocPartTwo)
			return info
		}
	}
	info.Doc = fmt.Sprintf("%s%s",
		modelConfigHelpDocPartOne,
		modelConfigHelpDocPartTwo)
	return jujucmd.Info(info)
}
589423
func (c *removeCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "remove-backup",
		Args:    "[--keep-latest|<ID>]",
		Purpose: "Remove the specified backup from remote storage.",
		Doc:     removeDoc,
	})
}
276947
func (c *AddCAASCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "add-k8s",
		Args:    "<k8s name>",
		Purpose: usageAddCAASSummary,
		Doc:     usageAddCAASDetails,
	})
}
866675
func (c *CharmResourcesCommand) Info() *cmd.Info {
	i := c.baseInfo()
	i.Name = "charm-resources"
	i.Aliases = []string{"list-charm-resources"}
	return jujucmd.Info(i)
}
182959
func (c *whoAmICommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "whoami",
		Purpose: "Print current login details.",
		Doc:     whoAmIDetails,
	})
}
934967
func (c *restoreCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "restore-backup",
		Purpose: "Restore from a backup archive to the existing controller.",
		Args:    "",
		Doc:     strings.TrimSpace(restoreDoc),
	})
}
666975
func info(command interface{}) (*CommandInfo, error) {
	typeof := reflect.TypeOf(command)

	// Going up the pointer chain to find the underlying struct
	for typeof.Kind() == reflect.Ptr {
		typeof = typeof.Elem()
	}

	field, ok := typeof.FieldByName("_")
	if !ok {
		return nil, fmt.Errorf(`missing meta ("_") field in %#v`, command)
	}

	name, nameOk := field.Tag.Lookup("name")
	description, _ := field.Tag.Lookup("description")

	if !nameOk {
		return nil, fmt.Errorf(`missing "name" key in the tag string of %#v`, command)
	}

	info := &CommandInfo{
		Name:        name,
		Description: description,
	}

	return info, nil
}
495917
func (c *showCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "show-offer",
		Args:    "[<controller>:]<offer url>",
		Purpose: "Shows extended information about the offered application.",
		Doc:     showCommandDoc,
	})
}
1256730
func (c *listImagesCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "list-images",
		Purpose: "lists cloud image metadata used when choosing an image to start",
		Doc:     listCommandDoc,
	})
}
163138
func (c *RemoveCAASCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "remove-k8s",
		Args:    "<k8s name>",
		Purpose: usageRemoveCAASSummary,
		Doc:     usageRemoveCAASDetails,
	})
}