clitest

package
v1.2.14-prerelease13 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCLIContext

func NewCLIContext(t *testing.T, app *cli.App, args ...CliArgument) *cli.Context

NewCLIContext creates a new cli context with optional arguments this is a useful to make testing of commands compact

Types

type CliArgument

type CliArgument func(t *testing.T, flags *flag.FlagSet, c *cli.Context)

CliArgument is a way to apply argument to given flagset/context

func BoolArgument

func BoolArgument(name string, value bool) CliArgument

BoolArgument introduces a new boolean argument for cli context

func Int64Argument

func Int64Argument(name string, value int64) CliArgument

Int64Argument introduces a new int64 argument for cli context

func IntArgument

func IntArgument(name string, value int) CliArgument

IntArgument introduces a new int argument for cli context

func StringArgument

func StringArgument(name, value string) CliArgument

StringArgument introduces a new string argument for cli context

func StringSliceArgument

func StringSliceArgument(name string, values ...string) CliArgument

StringSliceArgument introduces a new string slice argument for cli context

Jump to

Keyboard shortcuts

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