# README
cli - command-line interface utilities
a collection of utilities for working with github.com/urfave/cli
Installation
> go get github.com/go-corelibs/cli@latest
Examples
FlagStringer
import (
"github.com/urfave/cli/v2"
clcli "github.com/go-corelibs/cli"
)
func init() {
// - remove default text from boolean flag usage
// - place defaults and env vars on newlines
cli.FlagStringer = clcli.NewFlagStringer().
PruneDefaultBools(true).
DetailsOnNewLines(true).
Make()
}
Go-CoreLibs
Go-CoreLibs is a repository of shared code between the Go-Curses and Go-Enjin projects.
License
Copyright 2024 The Go-CoreLibs Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use file except in compliance with the License.
You may obtain a copy of the license at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# Functions
ClearEmptyCategories sets all flag.Category strings to empty if the specific category does not have any visible flags
gocyclo:ignore.
DecodeBaseFlag returns a BaseFlag representation of the given cli.Flag
gocyclo:ignore.
NewBaseFlag constructs a new BaseFlag instance.
NewFlagStringer creates a new FlagStringer instance, ready to be configured and made into a cli.FlagStringFunc.
ShowOptions prints each option (and it's aliases), one per line, to os.Stderr and with flags named "usage", "help", "version" and "verbose" separated and sorted after all other flags.
ShowUsage prints a very brief usage text line to os.Stderr.
ShowUsageAndExit calls ShowUsage and then os.Exit with the `exitCode` given.
ShowUsageOptions is like ShowUsage but includes a listing of all option names and aliases.
ShowUsageOptionsAndExit calls ShowUsageOptions and then os.Exit with the `exitCode` given.
# Structs
BaseFlag is a type containing only the common variables for any given cli.Flag type.
# Interfaces
FlagStringer is a buildable interface for constructing a pre-configured cli.FlagStringFunc instances.