Documentation ¶
Overview ¶
Package cmd uses the Cobra package to provide and handle all the interactions with the command-line interface in Linux.
Index ¶
- Constants
- Variables
- func Arch() string
- func Brand(w io.Writer, l *zap.SugaredLogger, b []byte) error
- func Commit(version string) string
- func Copyright() string
- func ExeTmpl() string
- func Execute(log *zap.SugaredLogger, c conf.Config) error
- func LastCommit() string
- func OS() string
- func ProgInfo(logr *zap.SugaredLogger, cfg conf.Config, version string) (string, error)
- func Vers(version string) string
- type ProgData
Constants ¶
View Source
const ( About = Title + " is the program to manage, maintain and optimise " + Domain + "." Author = "Ben Garrett" // Author is the primary programmer of this program. Domain = "defacto2.net" // Domain of the website. Program = "df2" // Program command. Title = "The Defacto2 tool" // Title of this program. URL = "https://github.com/Defacto2/df2" // URL of the program repository. )
Variables ¶
View Source
var ( ErrNoOutput = errors.New("no output command used") ErrPointer = errors.New("pointer value cannot be nil") )
View Source
var ( ErrConfig = errors.New("config cannot be empty") ErrCommand = errors.New("invalid command, please use one of the available commands") ErrID = errors.New("invalid id or uuid specified") ErrLogger = errors.New("logger cannot be nil") ErrNoID = errors.New("requires an id or uuid argument") )
Functions ¶
func Commit ¶
Commit returns a formatted, git commit description for this repository, including tag version and date.
func Copyright ¶
func Copyright() string
Copyright returns the copyright years and author of this program.
func Execute ¶
func Execute(log *zap.SugaredLogger, c conf.Config) error
Execute is a Cobra command that adds all child commands to the root and sets the appropriate flags. It is called by main.main() and only needs to be called once in the rootCmd.
func LastCommit ¶
func LastCommit() string
LastCommit returns the time and date of the last repo commit.
Types ¶
type ProgData ¶
type ProgData struct { Database string Ansilove string Webp string Magick string Netpbm string PngQuant string Arj string File string Lha string UnRar string UnZip string ZipInfo string Version string Revision string LastCommit string Path string Platform string GoVer string GoOS string Docker string Title string Cmd string }
ProgData is used for holding the version flag template data.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
arg
Package arg has structures used to store the flag values used by the cobra.Command methods.
|
Package arg has structures used to store the flag values used by the cobra.Command methods. |
run
Package run is a collection of work functions used by the cobra.Command methods.
|
Package run is a collection of work functions used by the cobra.Command methods. |
Click to show internal directories.
Click to hide internal directories.