cliutil

package
v3.0.0-...-c77a060 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cliutil is a collection of functions to help work with urfave/cli

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleCommands

func AssembleCommands(commandSlices ...[]cli.Command) (allCommands []cli.Command)

AssembleCommands slices of different command sets, merges and returns them as one full list

func ConcatFlags

func ConcatFlags(flagSets ...[]cli.Flag) (res []cli.Flag)

ConcatFlags combines multiple slices of flags together without modification

func CreateMultiwordCommand

func CreateMultiwordCommand(orig cli.Command) cli.Command

CreateMultiwordCommand creates a new cli.Command with subcommands for each word with the innermost one being identical to the original, but for the name and for being hidden.

For example, given a command called "example command", this creates a command called "example" with a subcommand called "command" - where "command" is identical to "example command". This is a workaround for urfave/cli not supporting multi-word commands.

func CreateMultiwordCommands

func CreateMultiwordCommands(cmds []cli.Command) (newCmds []cli.Command)

CreateMultiwordCommands is a workaround for urfave/cli not fully supporting multi-word Names for commands in a good way it looks at each subcommand of cmds, and creates hidden command trees to match any multi-word commands found.

func MergeCommand

func MergeCommand(dst *cli.Command, src cli.Command)

MergeCommand merges src into dst, only copying non-nil fields of src, and calling mergeCommands upon the .Subcommands and appending all .Flags

func MergeCommands

func MergeCommands(base []cli.Command, extras []cli.Command) (result []cli.Command)

MergeCommands copies over all the commands from base to result, then puts all the commands from extras in too, overwriting any provided fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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