tlcli

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Overview

Package tlcli provides helper utilities for command line programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CobraHelper

func CobraHelper(r Runner, pc string, subc string) *cobra.Command

func ReadFileLines

func ReadFileLines(fn string) ([]string, error)

func RunWithArgs

func RunWithArgs(r Runner, args []string) error

Types

type GenDocCommand

type GenDocCommand struct {
	Outpath string
	Delete  bool
	Command *cobra.Command
}

func (*GenDocCommand) AddFlags

func (cmd *GenDocCommand) AddFlags(fl *pflag.FlagSet)

func (*GenDocCommand) HelpDesc

func (cmd *GenDocCommand) HelpDesc() (string, string)

func (*GenDocCommand) Parse

func (cmd *GenDocCommand) Parse(args []string) error

func (*GenDocCommand) Run

func (cmd *GenDocCommand) Run() error

type NArgs

type NArgs struct {
	// contains filtered or unexported fields
}

func NewNArgs

func NewNArgs(v []string) *NArgs

func (*NArgs) Arg

func (fl *NArgs) Arg(i int) string

func (*NArgs) Args

func (fl *NArgs) Args() []string

func (*NArgs) NArg

func (fl *NArgs) NArg() int

type Runner

type Runner interface {
	AddFlags(*pflag.FlagSet)
	Parse([]string) error
	Run() error
}

Jump to

Keyboard shortcuts

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