(cmd *serpent.Command)
| 1015 | |
| 1016 | func (*OrganizationContext) optionName() string { return "Organization" } |
| 1017 | func (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 | |
| 1031 | func (o *OrganizationContext) ValueSource(inv *serpent.Invocation) (string, serpent.ValueSource) { |
| 1032 | opt := inv.Command.Options.ByName(o.optionName()) |
no test coverage detected