util

package
v0.0.0-...-1950331 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTerm

func ClearTerm()

func GetBoolFlag

func GetBoolFlag(cmd *cobra.Command, name string, defaultValue bool) bool

func GetIntFlag

func GetIntFlag(cmd *cobra.Command, name string, allowedValues []int, defaultValue int) int

func GetStringFlag

func GetStringFlag(cmd *cobra.Command, name string, allowedValues []string, defaultValue string) string

func GetWorkingDir

func GetWorkingDir() string

func IndexOf

func IndexOf(word string, data []string) int

func IndexOfInt

func IndexOfInt(num int, data []int) int

func RunCommand

func RunCommand(args []string, cwd string) error

func ZeroPad

func ZeroPad(num int, total int) string

func ZeroPadString

func ZeroPadString(in string, total string) string

Types

type PathObject

type PathObject struct {
	Abs  string
	Rel  string
	Dir  string
	Base string
	Name string
	Ext  string
}

func GetPathObj

func GetPathObj(f string) PathObject

func (PathObject) UpdateDir

func (p PathObject) UpdateDir(dir string) PathObject

func (PathObject) UpdateExt

func (p PathObject) UpdateExt(ext string) PathObject

func (PathObject) UpdateName

func (p PathObject) UpdateName(name string) PathObject

Jump to

Keyboard shortcuts

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