clitest

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func RunCommandLine added in v1.3.5

func RunCommandLine(t *testing.T, app *cli.App, cmdline string) error

RunCommandLine runs cmdline (a whole line like you'd type it in Shell)

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