subcommand

package
v0.0.0-...-b03d97b Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package subcommand defines commands in the Alma toolkit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvPrefix

func EnvPrefix(prefix, name string) string

EnvPrefix returns the prefix for enviroment variables for the subocommand.

func Usage

func Usage(fs *flag.FlagSet, envPrefix string, description string)

Usage prints the name, description, flags, and env vars for a subcommand.

func UsageNoFlags

func UsageNoFlags(fs *flag.FlagSet, description string)

UsageNoFlags prints the name and description of subcommand.

func ValidateSetNameAndSetIDFlags

func ValidateSetNameAndSetIDFlags(name, ID string) error

ValidateSetNameAndSetIDFlags ensures set name XOR set ID.

Types

type Config

type Config struct {
	ReadAccess    []string                                 // The API endpoints which will require read-only access.
	WriteAccess   []string                                 // The API endpoints which will require write access.
	FlagSet       *flag.FlagSet                            // The Flag set for this subcommand.
	ValidateFlags func() error                             // A function which validates that the flagset is valid after it is parsed.
	Run           func(context.Context, *api.Client) error // Call this function for this subcommand.
}

Config stores information about subcommands.

type Registry

type Registry map[string]*Config

Registry maps the string from the command line to the properties of a subcommand. The key is always the same as the FlagSet's name.

func (Registry) Register

func (r Registry) Register(c *Config)

Register the config with the registry.

Directories

Path Synopsis
bibs
cleanupcallnumbers
Package cleanupcallnumbers provides a subcommand which cleans up call numbers in holdings records.
Package cleanupcallnumbers provides a subcommand which cleans up call numbers in holdings records.
items/cancelrequests
Package cancelrequests provides a subcommand which cancels the requests on items in a set.
Package cancelrequests provides a subcommand which cancels the requests on items in a set.
items/requests
Package requests provides a subcommand which outputs the requests on items in a set.
Package requests provides a subcommand which outputs the requests on items in a set.
items/scanin
Package scanin provides a subcommand which scans in items in a set.
Package scanin provides a subcommand which scans in items in a set.
conf
dump
Package dump provides output from the API about Alma configuration.
Package dump provides output from the API about Alma configuration.

Jump to

Keyboard shortcuts

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