feat: add example

This commit is contained in:
Rogee
2024-12-09 14:57:47 +08:00
parent cd6f42de14
commit 524dc82d2f

View File

@@ -108,6 +108,12 @@ func Long(long string) Option {
} }
} }
func Example(example string) Option {
return func(cmd *cobra.Command) {
cmd.Example = example
}
}
func Run(run func(cmd *cobra.Command, args []string)) Option { func Run(run func(cmd *cobra.Command, args []string)) Option {
return func(cmd *cobra.Command) { return func(cmd *cobra.Command) {
cmd.Run = run cmd.Run = run