cmdutils

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cmdutils contains shared functions for commands.

Note that these functions may trigger a process shutdown, DO NOT call these from any other place other than the command line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepositoryToConfig added in v0.1.24

func AddRepositoryToConfig(repoURL string) error

func ExitWithError

func ExitWithError(message string, exitCode int)

ExitWithError exits the application gracefully with the provided exit status :exitCode, printing both message and stack trace at the `error` level

func ExitWithMessage added in v0.1.24

func ExitWithMessage(message string, exitCode int)

ExitWithMessage exits the application using the provided :exitCode, printing the message :message at the `info` level before that

func ExitWithProblem added in v0.1.24

func ExitWithProblem(message string, exitCode int)

ExitWithProblem exits the application with the provided exit status :exitCode, printing the provided message :message before exiting

func ExitWithStackTrace

func ExitWithStackTrace(message string)

ExitWithStackTrace exits the application with exit status 0 while printing both message and stack trace at the 'trace' level

func FilterOutLoadedRepositories added in v0.1.20

func FilterOutLoadedRepositories(
	repoURLsToAdd []string,
	alreadyPresent map[string]string,
) []string

FilterOutLoadedRepositories returns a slice of strings that has repository paths that do not already exist in the configuration :alreadyPresent argument

func GetGitRepoRootFromWorkingDirectory

func GetGitRepoRootFromWorkingDirectory() string

GetGitRepoRootFromWorkingDirectory returns the full path of the child directory containing a ./.git directory from the current working directory

func GetHomeDirectory added in v0.1.24

func GetHomeDirectory() string

func GetLoadedConfigFilePaths added in v0.1.20

func GetLoadedConfigFilePaths() []string

GetLoadedConfigFilePaths returns a slice of strings where each string is an absolute path to a loaded configuration file

func GetLoadedRepositories added in v0.1.20

func GetLoadedRepositories() map[string]string

GetLoadedRepositories retrieves repositories that have already been loaded and returns a `map[string]string` where the key value equals the local path of the repository and the value equals the full absolute path of the configuration file

Types

This section is empty.

Jump to

Keyboard shortcuts

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