cmd

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "swag-ts",
	Short: "A tiny cli tool that generates typescript types based on a provided OpenAPI Specifications",
	Long:  `Simply provide a OpenAPI Specification and swag-ts will generate typescript types for you. You can provide json or yaml definitions on your local filesystem or a remote url.`,
	Run: func(cmd *cobra.Command, args []string) {
		if version {
			fmt.Printf("swag-ts - v%s (%s)\n", config.Version, config.Date)
			return
		}

		if specPath != "" {
			printBanner()

			g := generator.NewGenerator(specPath, genType)

			err := g.GenerateTypes(output)
			if err != nil {
				log.Fatalf("Failed to generate types: %s", err)
			}

			return
		}

		_ = cmd.Help()
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL