Documentation
¶
Overview ¶
Package cli provides utilities to work with the command-line interface.
Index ¶
Constants ¶
View Source
const ( // UserAgent is the user agent string used by frizbee. // // TODO (jaosorior): Add version information to this. UserAgent = "frizbee" // GitHubTokenEnvKey is the environment variable key for the GitHub token //nolint:gosec // This is not a hardcoded credential GitHubTokenEnvKey = "GITHUB_TOKEN" // TokenHelpText is the help text for the GitHub token TokenHelpText = "NOTE: It's recommended to set the " + GitHubTokenEnvKey + " environment variable given that GitHub has tighter rate limits on anonymous calls." )
Variables ¶
View Source
var ( // CLIVersion is the version of the frizbee CLI. // nolint: gochecknoglobals CLIVersion = "dev" // VerboseCLIVersion is the verbose version of the frizbee CLI. // nolint: gochecknoglobals VerboseCLIVersion = "" )
Functions ¶
func DeclareFrizbeeFlags ¶
DeclareFrizbeeFlags declares the flags common to all replacer commands.
Types ¶
type Helper ¶
Helper is a common struct for implementing a CLI command that replaces files.
func (*Helper) CheckModified ¶ added in v0.1.7
CheckModified checks if any files were modified and returns an error if there were.
func (*Helper) Logf ¶
Logf logs the given message to the given command's stderr if the command is not quiet.
func (*Helper) ProcessOutput ¶
ProcessOutput processes the given output files. If the command is quiet, the output is discarded. If the command is a dry run, the output is written to the command's stdout. Otherwise, the output is written to the given filesystem.
Click to show internal directories.
Click to hide internal directories.