egkong

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 4 Imported by: 0

README

egkong

PkgGoDev Buil Coverage Status Go Report Card

Package matthewdunsdon/egkong provides you with a library to seamlessly integrate kong with egcmd.

Currently, this library is not intended for use in production, predominantly as it has been created learning golang.



Install

With a correctly configured Go toolchain:

go get github.com/matthewdunsdon/egkong

Usage

The simplist approach is to create a configured kingpin app is to use the .New() function:

import (
	"fmt"
	"os"

	"github.com/alecthomas/kong"
	"github.com/matthewdunsdon/egkong"
)

var cli struct {
	// kong cli
}

var (
	parser, appExamples = egkong.New(&cli, kong.Name("myapp"), kong.Description("This is my app."))
	_                   = appExamples.Example("init", "Ius legimus nonumes te, pri dicat nominavi copiosae id, odio rebum facilis ea pro.")

	initCmd   = app.Command("init", "Initialise cashflow data.")
	initCmdEx = appExamples.Command("init")
	_         = initCmdEx.Example("--yes", "At vis primis debitis, ei verear omittantur signiferumque mei, quo esse aperiri an. Dolore vocent consequuntur pro an, nam no iusto tamquam suscipit.")
)

License

MIT licensed. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cli interface{}, options ...kong.Option) (parser *kong.Kong, appExamples *egcmd.App, err error)

New creates both kong and egcmd application, which have the help printer configured so that examples are shown.

Types

type ExamplesFinder

type ExamplesFinder interface {
	Find(command string) egcmd.ExamplesFound
}

ExamplesFinder is the interface that wraps the Find method.

Find returns the examples that belong to a particular command.

Jump to

Keyboard shortcuts

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