cmd

package
v0.0.0-...-c665954 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EditCommand = &cobra.Command{
	Use:   "edit [package]",
	Short: "Edit package",
	Long:  "Open editor for specified package",
	Args:  cobra.ExactArgs(1),
	Run: func(cmd *cobra.Command, args []string) {

		ctx, cancel := context.WithCancel(context.Background())

		signalChannel := make(chan os.Signal, 1)
		signal.Notify(signalChannel, os.Interrupt)
		go func() {
			select {
			case <-signalChannel:
				cancel()
			case <-ctx.Done():
			}
		}()
		defer signal.Stop(signalChannel)
		defer cancel()

		if err := generate.Save(os.Stdout, args[0]); err != nil {
			log.Fatal(err)
		}

		if err := edit.Open(ctx, cancel, vos.Os(), os.Stdout, args[0]); err != nil {
			log.Fatal(err)
		}
	},
}
View Source
var GenerateCommand = &cobra.Command{
	Use:   "generate [packages]",
	Short: "Generate code",
	Long:  "Generate code for specified package(s)",
	Args:  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		if err := generate.Save(os.Stdout, args...); err != nil {
			log.Fatal(err)
		}
	},
}
View Source
var RootCommand = &cobra.Command{
	Use:   "frizz",
	Short: "Frizz short description",
	Long:  "Frizz long description",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Frizz")
	},
}
View Source
var VersionCommand = &cobra.Command{
	Use:   "version",
	Short: "Version short description",
	Long:  "Version long description",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Version")
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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