command

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

README

Reusable Command Line Options*

*for spf13/cobra-based CLI tools

This repository contains reusable command line options that some of the carabiner-tools share.

This repo is in it's early days, we expect it to mature slowly but feel free to file issues or suggestions if you find it useful.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyOptions

type KeyOptions struct {
	PublicKeyPaths []string
}

func (*KeyOptions) AddFlags

func (ko *KeyOptions) AddFlags(cmd *cobra.Command)

AddFlags adds the options flags to a command

func (*KeyOptions) ParseKeys

func (ko *KeyOptions) ParseKeys() ([]key.PublicKeyProvider, error)

ParseKeys parses the key files and returns a slice of public key providers.

func (*KeyOptions) Verify

func (ko *KeyOptions) Verify() error

Verify checks the options. Key files are verified to check if they exist

type OptionsSet

type OptionsSet interface {
	AddFlags(*cobra.Command)
	Verify() error
}

OptionsSet is an interface that defines the functions options set need to implement to make them reusable.

Jump to

Keyboard shortcuts

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