cmd

package
v0.0.0-...-993f9dd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUsageTemplateFunc

func AddUsageTemplateFunc(name string, f interface{})

AddUsageTemplateFunc adds a template function to the usage template.

func EnableUsageTemplating

func EnableUsageTemplating(cmds ...*cobra.Command)

EnableUsageTemplating enables gotemplates for usage strings, i.e. cmd.Short, cmd.Long, and cmd.Example. The data for the template is the command itself. Especially useful are `.Root.Name` and `.CommandPath`. This will be inherited by all subcommands, so enabling it on the root command is sufficient.

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately.

func RegisterFlags

func RegisterFlags(flags *pflag.FlagSet)

func TemplateCommandField

func TemplateCommandField(cmd *cobra.Command, field string) (string, error)

Types

type Handler

type Handler struct {
}

func NewHandler

func NewHandler() *Handler

func (*Handler) GenerateRegistry

func (h *Handler) GenerateRegistry(ctx context.Context) *registry.Base

func (*Handler) NewMigratDown

func (h *Handler) NewMigratDown() *cobra.Command

func (*Handler) NewMigratUp

func (h *Handler) NewMigratUp() *cobra.Command

func (*Handler) NewMigrate

func (h *Handler) NewMigrate() *cobra.Command

func (*Handler) NewRootCmd

func (h *Handler) NewRootCmd() *cobra.Command

func (*Handler) NewServer

func (h *Handler) NewServer() *cobra.Command

func (*Handler) NewServerStart

func (h *Handler) NewServerStart() *cobra.Command

func (*Handler) NewUser

func (h *Handler) NewUser() *cobra.Command

func (*Handler) RegisterCommandRecursive

func (h *Handler) RegisterCommandRecursive(parent *cobra.Command)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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