MCPcopy Index your code
hub / github.com/coder/coder / AttachOptions

Method AttachOptions

cli/root.go:1017–1029  ·  view source on GitHub ↗
(cmd *serpent.Command)

Source from the content-addressed store, hash-verified

1015
1016func (*OrganizationContext) optionName() string { return "Organization" }
1017func (o *OrganizationContext) AttachOptions(cmd *serpent.Command) {
1018 cmd.Options = append(cmd.Options, serpent.Option{
1019 Name: o.optionName(),
1020 Description: "Select which organization (uuid or name) to use.",
1021 // Only required if the user is a part of more than 1 organization.
1022 // Otherwise, we can assume a default value.
1023 Required: false,
1024 Flag: "org",
1025 FlagShorthand: "O",
1026 Env: "CODER_ORGANIZATION",
1027 Value: serpent.StringOf(&o.FlagSelect),
1028 })
1029}
1030
1031func (o *OrganizationContext) ValueSource(inv *serpent.Invocation) (string, serpent.ValueSource) {
1032 opt := inv.Command.Options.ByName(o.optionName())

Callers 14

templatePresetsListMethod · 0.95
scaletestTaskStatusMethod · 0.95
provisionerJobsCancelMethod · 0.95
organizationsMethod · 0.95
templateVersionsListMethod · 0.95
templateDeleteMethod · 0.95
groupListMethod · 0.95
provisionerKeysDeleteMethod · 0.95

Calls 1

optionNameMethod · 0.95

Tested by

no test coverage detected