Documentation ¶
Overview ¶
Package cobraflags implements some Flag and Command addons. They are split into a seperate package to be able to move them to a sperate repository eventually.
Index ¶
- func AddCompletionCommand(parent, root *cobra.Command) *cobra.Command
- func AddDocumentationCommand(parent, root *cobra.Command) *cobra.Command
- func AddGeneratorCommand(parent *cobra.Command) *cobra.Command
- func CheckAll(cmd *cobra.Command, args []string, ...) (err error)
- func Exclusive(mode os.FileMode) func(name string) (*os.File, error)
- func NoArgs(cmd *cobra.Command, args []string) (err error)
- func Readonly() func(name string) (*os.File, error)
- func Truncate(mode os.FileMode) func(name string) (*os.File, error)
- type DirFlag
- type FileFlag
- type Key32Flag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDocumentationCommand ¶
func CheckAll ¶
func CheckAll(cmd *cobra.Command, args []string, checker ...func(*cobra.Command, []string) error) (err error)
CheckAll runs pre-run checks of all given checkers.
func Exclusive ¶
Exclusive is a fileopener for FileFlag, which attempts to open the file for writing exclusively. I.e. it fails if the file already exists.
Types ¶
Click to show internal directories.
Click to hide internal directories.