Files
atomctl/cmd/swag_fmt.go
2025-01-22 14:50:54 +08:00

26 lines
460 B
Go

package cmd
import (
"github.com/rogeecn/swag/format"
"github.com/spf13/cobra"
)
func CommandSwagFmt(root *cobra.Command) {
cmd := &cobra.Command{
Use: "fmt",
Aliases: []string{"f"},
Short: "swag format",
RunE: commandSwagFmtE,
}
root.AddCommand(cmd)
}
func commandSwagFmtE(cmd *cobra.Command, args []string) error {
return format.New().Build(&format.Config{
SearchDir: "./app/http",
Excludes: "",
MainFile: "main.go",
})
}