Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add a field on command to deprecate #24

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

joobisb
Copy link
Contributor

@joobisb joobisb commented Nov 18, 2024

Closes #13

Adds a field on a command to deprecate.

How to use:

&serpent.Command{
		Use:        "frobnicate",
		Short:      "Frobnicate URLs",
		Long:       "This command frobnicates URLs in the old way.",
		Deprecated: "This command will be removed in v2.0.0.",
		Options:    o.CLI(),
		Handler: func(inv *serpent.Invocation) error {
			fmt.Println("Command successfully invoked:", o.URL.String())
			return nil
		},
	}
Example deprecated command with help :
image
Example deprecated command:
image

@joobisb
Copy link
Contributor Author

joobisb commented Nov 18, 2024

@Emyrk could you please take a look

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very reasonable 👍

This matches how cobra does it too.

@Emyrk
Copy link
Member

Emyrk commented Nov 18, 2024

I just ran go test locally. I am unsure how to get github actions running here. It all passed.

@Emyrk Emyrk merged commit 5f3d052 into coder:main Nov 18, 2024
@joobisb joobisb deleted the issues#13 branch November 18, 2024 18:05
@joobisb
Copy link
Contributor Author

joobisb commented Nov 18, 2024

@Emyrk Thanks for reviewing and merging this. What is the release cadence for serpent? Can we release a new version v0.10.0?

@Emyrk
Copy link
Member

Emyrk commented Nov 18, 2024

@joobisb I will tag it!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a field on a command to deprecate
2 participants