# Functions
AddDefaults copies data from a FlagSet into the map of default configuration settings.
AddFlags adds collections of flags to a flag consumer (typically a cobra command flags instance).
ApplicationPath returns the path to application-specific data (%APPDATA%\appName).
AssignFileSystem sets the current afero.Fs instance and returns the original pre-assignment value.
CopyFile copies a file.
Copyright returns an appropriately formatted copyright statement; see https://github.com/majohn-r/cmd-toolkit/issues/17.
DecoratedAppName returns the app name with its version and build timestamp; see https://github.com/majohn-r/cmd-toolkit/issues/17.
DefaultConfigFileStatus returns the path of the defaults config file and whether that file exists.
DereferenceEnvVar scans a string for environment variable references, looks up the values of those environment variables, and replaces the references with their values.
DirExists returns whether the specified file exists as a directory.
EmptyConfiguration creates an empty Configuration instance.
ErrorToString converts an error into an easy-to-read string.
FileSystem returns the current afero.Fs instance.
FormatBuildDependencies returns build dependency data formatted nicely; see https://github.com/majohn-r/cmd-toolkit/issues/17.
FormatGoVersion returns the formatted go version; see https://github.com/majohn-r/cmd-toolkit/issues/17cmdtoolkit.
GetBool gets the boolean value of a specific flag, handling common error conditions.
GetInt gets the integer value of a specific flag, handling common error conditions.
GetString gets the string value of a specific flag, handling common error conditions.
InitApplicationPath ensures that the application path exists.
InitLogging sets up logging at the default log level.
InitLoggingWithLevel initializes logging with a specific log level.
InterpretBuildData interprets the output of calling buildInfoReader() into easily consumed forms; see https://github.com/majohn-r/cmd-toolkit/issues/17.
LogCommandStart logs the beginning of command execution; if the provided map contains a "command" value, then the name parameter is ignored.
LogFileDeletionFailure logs errors when a file cannot be deleted; does not write anything to the error output because that typically needs additional context.
LogPath returns the path for log files; see https://github.com/majohn-r/cmd-toolkit/issues/16.
Mkdir makes the specified directory; succeeds if the directory already exists.
NewElevationControl creates a new instance of elevationControl that does not use an environment variable to determine whether execution with elevated privileges is desired.
NewElevationControlWithEnvVar creates a new instance of elevationControl that uses an environment variable to determine whether execution with elevated privileges is desired.
NewEnvVarMemento creates a new instance of EnvVarMemento based on the state of the environment variable 'name'.
NewExitProgrammingError creates an ExitError suitable for a programming error to have terminated the command.
NewExitSystemError creates an ExitError suitable for a system call failure to have terminated the command.
NewExitUserError creates an ExitError suitable for a user error to have terminated the command.
NewIntBounds creates an instance of IntBounds, sorting the provided value into reasonable fields.
PlainFileExists returns whether the specified file exists as a plain file (i.e., not a directory).
ProcessFlagErrors handles a slice of errors; returns true iff the slice is empty.
ProcessIsElevated determines whether the current process is running with elevated privileges.
ReadDefaultsConfigFile reads defaults.yaml from the specified path and returns a pointer to a cooked Configuration instance; if there is no such file, then an empty Configuration is returned and ok is true.
ReadDirectory returns the contents of a specified directory.
ReadFlags reads the flags from a producer (typically a cobra commands flag structure).
ReportFileCreationFailure reports an error creating a file to error output and to the log.
SetApplicationPath is used to set applicationPath to a known value; intent is for use in testing scenarios.
StyledFlowerBox draws a box around the provided slice of strings in a specified style.
ToErrorInterface translates a nil ExitError instances to a nil error instances; non-nil ExitError instances are returned as is.
WritableDefaults returns the current state of the defaults configuration as a slice of bytes.
# Constants
ASCIIFlowerBox uses ASCII characters ('+', '+', '+', '+', '-', and '|').
BoolType represents a boolean flag type.
CurvedFlowerBox is uses light lines rounded corners ('╭', '╮', '╰', '╯', '─', and '│').
DoubleLinedFlowerBox uses double line characters ('╔', '╗', '╚', '╝', '═', and '║').
HeavyLinedFlowerBox uses heavy lined characters ('┏', '┓', '┗', '┛', '━', and '┃').
IntType represents an integer flag type.
LightLinedFlowerBox uses heavy lined characters ('┌', '┐', '└', '┘', '─', and '│').
-rwxr-xr-x.
StdFilePermissions is the standard mode constant for plain files; it sets up the file to be read/write for its owner, read only for everyone else.
StringType represents a string flag type.
# Variables
GetCurrentProcessToken gets the windows token representing the current process.
IsCygwinTerminal determines whether a particular file descriptor (e.g., os.Stdin.Fd()) is a Cygwin terminal.
IsElevated determines whether a specified windows token represents a process running with elevated privileges.
IsTerminal determines whether a particular file descriptor (e.g., os.Stdin.Fd()) is a terminal.
LogWriterInitFn is a function to get an io.Writer with which to initialize the logger; this variable setting makes it easy to substitute another function in unit tests.
ProductionLogger is the production implementation of the output.Logger interface.
Scanf is the standard function for reading and scanning a line from stdin; it is used by the configured exit function to allow the user control over when to close the terminal window.
ShellExecute is the windows function that runs the specified process with elevated privileges.
# Structs
CommandFlag captures a flag value and whether it was set by the user, i.e., on the command line.
Configuration defines the data structure for configuration information.
EnvVarMemento encapsulates information about an environment variable: its name, its value, and whether it was set when accessed.
ExitError encapsulates the command in which the error occurred, and the kind of error that terminated the command.
FlagDetails captures the data needed by the cobra command code: a flag's abbreviated name (which may be empty), a usage string, its expected type, and its default value.
FlagSet captures a set of flags (typically, but not necessarily, associated with a cobra command) and the details of the flags for that set.
IntBounds holds the bounds for an int value which has a minimum value, a maximum value, and a default that lies within those bounds.
# Interfaces
ElevationControl defines behavior for code pertaining to running a process with elevated privileges.
FlagProducer encapsulates critical behavior of the cobra command flags for reading flag values and whether those values are changed (i.e., are defined on the command line).
# Type aliases
FlowerBoxStyle specifies a style of drawing flower box borders.