cmdbase

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 17 Imported by: 1

README

cmdbase

Go Reference

Base initialization and helpers for our CLI applications.

Install

go get github.com/altipla-consulting/cmdbase

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using make gofmt.

License

MIT License

Documentation

Overview

Package cmdbase provides base initialization and helpers for our CLI applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdRoot

func CmdRoot(name, short string, opts ...RootOption) *cobra.Command

CmdRoot creates a new root command. Can only be called once per application.

func Main

func Main()

func Neutralf

func Neutralf(format string, args ...interface{})

func Successf

func Successf(format string, args ...interface{})

Types

type RootOption

type RootOption func(settings *root.Settings) error

RootOption configures the root command.

func WithFileLogger added in v0.2.0

func WithFileLogger(config func() (*lumberjack.Logger, error)) RootOption

WithFileLogger configures logrus to emit logs to a file with rotation.

func WithInstall

func WithInstall() RootOption

WithInstall configures an install command that installs the autocomplete script in the user's bashrc.

func WithUpdate

func WithUpdate(pkgname string) RootOption

WithUpdate configures an update command that installs using Go the remote repository.

Directories

Path Synopsis
Package cfpackages configures our internal Cloudflare R2 packages repository to install & update the command.
Package cfpackages configures our internal Cloudflare R2 packages repository to install & update the command.
internal

Jump to

Keyboard shortcuts

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