cmdchat

package
v0.6.9-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InfoCmd = &cobra.Command{

	Use: "info [name]",

	Short: "print details of a specific chat plugin",

	Long: infoLong,

	Run: func(cmd *cobra.Command, args []string) {

		ga.SendCommandPath(cmd.CommandPath())

		var err error

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'name'")
			cmd.Usage()
			os.Exit(1)
		}

		var name string

		if 0 < len(args) {

			name = args[0]

		}

		var entrypoints []string

		if 1 < len(args) {

			entrypoints = args[1:]

		}

		err = InfoRun(name, entrypoints)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var ListCmd = &cobra.Command{

	Use: "list",

	Short: "print available chat plugins in the current module",

	Long: listLong,

	Run: func(cmd *cobra.Command, args []string) {

		ga.SendCommandPath(cmd.CommandPath())

		var err error

		err = ListRun(args)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}
View Source
var WithCmd = &cobra.Command{

	Use: "with [name]",

	Short: "chat with a plugin in the current module",

	Long: withLong,

	Run: func(cmd *cobra.Command, args []string) {

		ga.SendCommandPath(cmd.CommandPath())

		var err error

		if 0 >= len(args) {
			fmt.Println("missing required argument: 'name'")
			cmd.Usage()
			os.Exit(1)
		}

		var name string

		if 0 < len(args) {

			name = args[0]

		}

		var entrypoints []string

		if 1 < len(args) {

			entrypoints = args[1:]

		}

		err = WithRun(name, entrypoints)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}

Functions

func InfoRun

func InfoRun(name string, entrypoints []string) (err error)

func ListRun

func ListRun(args []string) (err error)

func WithRun

func WithRun(name string, entrypoints []string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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