Flags instead of PersistentFlag

This commit is contained in:
Caleb Brose 2022-12-13 01:20:49 +00:00
parent 57c53e6268
commit 56006eefa6

View file

@ -289,7 +289,8 @@ func (c codespace) running() bool {
// which instructs the user to use -R instead.
func addDeprecatedRepoShorthand(cmd *cobra.Command, target *string) error {
cmd.Flags().StringVarP(target, "repo-deprecated", "r", "", "(Deprecated) Shorthand for --repo")
if err := cmd.PersistentFlags().MarkHidden("repo-deprecated"); err != nil {
if err := cmd.Flags().MarkHidden("repo-deprecated"); err != nil {
return fmt.Errorf("error marking `-r` shorthand as hidden: %w", err)
}