list

package
v0.0.0-...-5b10271 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListCmd = climax.Command{
	Name:  "list",
	Brief: "List available recipes",
	Help:  "List available recipes",
	Flags: []climax.Flag{
		{
			Name:     "directory",
			Short:    "d",
			Usage:    `--directory=<path-to-directory>`,
			Help:     `Directory to look for the recipe`,
			Variable: true,
		},
	},
	Handle: func(ctx climax.Context) int {
		var (
			directory string
			recipes   []string
			err       error
			ok        bool
		)

		if directory, ok = ctx.Get("directory"); !ok {
			directory = utils.RecipesDirectory()
		}
		directory, err = filepath.Abs(directory)

		recipes, err = utils.RecipesInDirectory(directory)
		if err != nil {
			log.Fatal(err)
		}

		fmt.Println(recipes)

		return 0
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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