cli

package
v0.0.0-...-14f9994 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package cli organizes and implements a command line program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) int

Run creates an App, performs the App's tasks, and returns an exit value.

Types

type App

type App struct {
	ExitValue     int
	HelpWanted    bool
	Verbose       bool
	VersionWanted bool
}

App stores information about the application's state.

func (*App) CheckStatus

func (app *App) CheckStatus(linkCh <-chan *Link) <-chan *Link

func (*App) Display

func (app *App) Display(statusCh <-chan *Link, logger *slog.Logger)

func (*App) FileGen

func (app *App) FileGen(files []string, logger *slog.Logger) chan *File

func (*App) LinkGen

func (app *App) LinkGen(upstream chan *File) chan *Link

func (*App) NoOp

func (app *App) NoOp() bool

NoOp determines whether an App should bail out.

func (*App) ParseFlags

func (app *App) ParseFlags(args []string) []string

ParseFlags handles flags and options in my finicky way.

type File

type File struct {
	Name    string
	Content []byte
}

File stores information and data for a file.

type Link struct {
	File   string
	URL    string
	Status int
	Err    error
}

Link stores information about a link.

Jump to

Keyboard shortcuts

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