addDeprecatedRepoShorthand adds a -r parameter (deprecated shorthand for --repo) which instructs the user to use -R instead.
(cmd *cobra.Command, target *string)
| 234 | // addDeprecatedRepoShorthand adds a -r parameter (deprecated shorthand for --repo) |
| 235 | // which instructs the user to use -R instead. |
| 236 | func addDeprecatedRepoShorthand(cmd *cobra.Command, target *string) error { |
| 237 | cmd.Flags().StringVarP(target, "repo-deprecated", "r", "", "(Deprecated) Shorthand for --repo") |
| 238 | |
| 239 | if err := cmd.Flags().MarkHidden("repo-deprecated"); err != nil { |
| 240 | return fmt.Errorf("error marking `-r` shorthand as hidden: %w", err) |
| 241 | } |
| 242 | |
| 243 | if err := cmd.Flags().MarkShorthandDeprecated("repo-deprecated", "use `-R` instead"); err != nil { |
| 244 | return fmt.Errorf("error marking `-r` shorthand as deprecated: %w", err) |
| 245 | } |
| 246 | |
| 247 | if cmd.Flag("codespace") != nil { |
| 248 | cmd.MarkFlagsMutuallyExclusive("codespace", "repo-deprecated") |
| 249 | } |
| 250 | |
| 251 | return nil |
| 252 | } |
| 253 | |
| 254 | // filterCodespacesByRepoOwner filters a list of codespaces by the owner of the repository. |
| 255 | func filterCodespacesByRepoOwner(codespaces []*api.Codespace, repoOwner string) []*api.Codespace { |
no test coverage detected