manhelp

package module
v0.0.0-...-fd6db4c Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: MIT Imports: 3 Imported by: 0

README

Manhelp

A help information provider

Why Manhelp

  • manhelp lets you add help information easily
  • Yeph,the makefile would be a heplful template for your project

Getting Started

Make sure you have Go installed

go get -u github.com/linnv/manhelp/...
cd $GOPATH/src/github.com/linnv/manhelp
make

then you should see two executable apps under example/, take a look at them and enjoy!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "None"
	BuildTime = "None"
	Branch    = "None"
	GitHash   = "None"
)
View Source
var ManHelpList []ManHelper

Functions

func AddManHelper

func AddManHelper(newHelpers ...ManHelper) error

func BasicManHelp

func BasicManHelp()

func BasicManHelpMain

func BasicManHelpMain()

func Main

func Main()

func Readline

func Readline(line string)

Types

type HelpInfo

type HelpInfo struct {
	Alias       []string
	FullName    []string
	Description string
	ExecuteFunc func()
}

HelpInfo defines one help item

func (HelpInfo) Help

func (hi HelpInfo) Help() string

func (HelpInfo) Keys

func (hi HelpInfo) Keys() []string

func (HelpInfo) Match

func (hi HelpInfo) Match(name string) (bool, func())

type ManHelper

type ManHelper interface {
	//Match() find the help item and return its exection if found
	Match(string) (bool, func())
	//Help() return usage description
	Help() string
	//Keys will be used to validate duplication
	Keys() []string
}

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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