help

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &bonzai.Cmd{
	Name: `help`,

	Long: ` 
		The {{pre .Name}} command displays the help information for the
		immediate command before it unless *one*, or ***more***,
		***arguments*** is passed and matches a potential command path for

		# Already a Go thing

		~~~go
		fmt.Println("something")
		~~~

		1. adsfasdf
		2. jkaldsfkj

		- one
		- two

		* ten
		* twenty

		the previous command. In this way this command can be used at the
		top level so users can quickly add it to get essential help
		information about any command or just the previous command. `,

	Call: func(x *bonzai.Cmd, args ...string) error {

		if len(args) > 0 {
			x, args = x.Caller.Seek(args)
		} else {
			x = x.Caller
		}

		if Renderer != nil {
			r, err := Renderer.Render(x, x.Funcs, x.Mark())
			if err != nil {
				return err
			}
			out, err := io.ReadAll(r)
			if err != nil {
				return err
			}
			term.Print(string(out))
			return nil
		}

		term.Print(x.MarkString())

		return nil
	},
}
View Source
var Renderer mark.Renderer

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
test
help-test command

Jump to

Keyboard shortcuts

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