help

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package help print manager and command information on terminal.

Source code mode

go run main.go
go run main.go help
go run main.go help docs

Built file mode

./demo
./demo help
./demo help docs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (managers.Command, error)

New function create and return instance.

Types

type Command

type Command struct {
	Command managers.Command
	Err     error
	Name    string
}

func (*Command) Handle

func (o *Command) Handle(m managers.Manager, a managers.Arguments) error

Handle callable registered on command manager interface.

func (*Command) HandleCommand

func (o *Command) HandleCommand(a managers.Arguments, c managers.Command) error

HandleCommand generate command information and print.

func (*Command) HandleManager

func (o *Command) HandleManager(m managers.Manager, a managers.Arguments) error

HandleManager generate manager information and print.

func (*Command) RenderCommands

func (o *Command) RenderCommands(m managers.Manager)

RenderCommands print manager command list.

Commands:
  docs         Build application document files
  kv:upload    Collect local config files and upload to consul

func (*Command) RenderDescription

func (o *Command) RenderDescription(str string)

RenderDescription print command description information.

func (*Command) RenderGuider

func (o *Command) RenderGuider(script string)

RenderGuider print guide information.

func (*Command) RenderOption

func (o *Command) RenderOption(c managers.Command)

RenderOption print option information.

Options:
  -b, --base=string      Specify working base path
      --config=string    Specify config path

func (*Command) RenderUsage

func (o *Command) RenderUsage(script, name string)

RenderUsage print usage information.

Usage: ./app COMMAND [OPTION]
Usage: ./app help COMMAND

func (*Command) RenderVersion

func (o *Command) RenderVersion()

RenderVersion print version information.

Version: 3.0.0

func (*Command) SplitWords

func (o *Command) SplitWords(w int, str string) []string

SplitWords convert long-text string as multi-rows slice with specified width.

Jump to

Keyboard shortcuts

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