appdev

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdDev = &cli.Command{
	Hidden: true,
	Name:   "debug",
	Usage:  "only for dev/debug",
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name: "hello",
		},
		&cli.BoolFlag{
			Name: "count-code-lines",
		},
	},
	Action: func(c *cli.Context) error {
		if c.Bool("count-code-lines") {
			RunCountCodeLines()
			os.Exit(0)
		}

		if c.Bool("hello") {
			_, wat, err := api.BuildFile(
				config.DefaultConfig(),
				"hello.wa", "func main() { println(123) }",
			)
			if err != nil {
				if len(wat) != 0 {
					fmt.Println(string(wat))
				}
				fmt.Println(err)
				os.Exit(1)
			}
			fmt.Println(string(wat))
			os.Exit(0)
		}

		fmt.Println("...dev...")
		return nil
	},
}

Functions

func RunCountCodeLines added in v0.9.0

func RunCountCodeLines()

Types

This section is empty.

Jump to

Keyboard shortcuts

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