gincmd

package
v0.0.0-...-854ad97 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package gincmd defines the subcommands of the gin command line client. It handles setting up the commands, their usage and help text (including examples), the top-level command logic, and output formatting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRemoteCmd

func AddRemoteCmd() *cobra.Command

AddRemoteCmd sets up the 'add-remote' repository subcommand

func AddServerCmd

func AddServerCmd() *cobra.Command

AddServerCmd sets up the 'add-server' command for adding new server configurations

func AnnexCmd

func AnnexCmd() *cobra.Command

AnnexCmd sets up the 'annex' passthrough subcommand

func CheckError

func CheckError(err error)

CheckError exits the program if an error is passed to the function. The error message is checked for known error messages and an informative message is printed. Otherwise, the error message is printed to stderr.

func CheckErrorMsg

func CheckErrorMsg(err error, msg string)

CheckErrorMsg exits the program if an error is passed to the function. Before exiting, the given msg string is printed to stderr.

func CommitCmd

func CommitCmd() *cobra.Command

CommitCmd sets up the 'commit' subcommand

func CreateCmd

func CreateCmd() *cobra.Command

CreateCmd sets up the 'create' subcommand

func DeleteCmd

func DeleteCmd() *cobra.Command

DeleteCmd sets up the 'delete' repository subcommand

func Die

func Die(msg interface{})

Die prints an error message to stderr and exits the program with status 1.

func DownloadCmd

func DownloadCmd() *cobra.Command

DownloadCmd sets up the 'download' subcommand

func Exit

func Exit(msg string)

Exit prints a message to stdout and exits the program with status 0.

func GetCmd

func GetCmd() *cobra.Command

GetCmd sets up the 'get' repository subcommand

func GetContentCmd

func GetContentCmd() *cobra.Command

GetContentCmd sets up the 'get-content' subcommand

func GitCmd

func GitCmd() *cobra.Command

GitCmd sets up the 'git' passthrough subcommand

func InfoCmd

func InfoCmd() *cobra.Command

InfoCmd sets up the user 'info' subcommand

func InitCmd

func InitCmd() *cobra.Command

InitCmd sets up the 'init' repository subcommand

func KeysCmd

func KeysCmd() *cobra.Command

KeysCmd sets up the 'keys' list, add, delete subcommand(s)

func LockCmd

func LockCmd() *cobra.Command

LockCmd sets up the file 'lock' subcommand

func LoginCmd

func LoginCmd() *cobra.Command

LoginCmd sets up the 'login' subcommand

func LogoutCmd

func LogoutCmd() *cobra.Command

LogoutCmd sets up the 'logout' subcommand

func LsRepoCmd

func LsRepoCmd() *cobra.Command

LsRepoCmd sets up the file 'ls' subcommand

func RemotesCmd

func RemotesCmd() *cobra.Command

RemotesCmd sets up the 'remotes' subcommand

func RemoveContentCmd

func RemoveContentCmd() *cobra.Command

RemoveContentCmd sets up the 'remove-content' subcommand

func RemoveRemoteCmd

func RemoveRemoteCmd() *cobra.Command

RemoveRemoteCmd sets up the 'remove-remote' repository subcommand

func RemoveServerCmd

func RemoveServerCmd() *cobra.Command

RemoveServerCmd sets up the 'remove-server' repository subcommand

func RepoInfoCmd

func RepoInfoCmd() *cobra.Command

RepoInfoCmd sets up the 'repoinfo' listing subcommand

func ReposCmd

func ReposCmd() *cobra.Command

ReposCmd sets up the 'repos' listing subcommand

func ServersCmd

func ServersCmd() *cobra.Command

ServersCmd sets up the 'servers' subcommand

func SetUpCommands

func SetUpCommands(verinfo VersionInfo) *cobra.Command

SetUpCommands sets up all the subcommands for the client and returns the root command, ready to execute.

func SyncCmd

func SyncCmd() *cobra.Command

SyncCmd sets up the 'sync' subcommand

func UnlockCmd

func UnlockCmd() *cobra.Command

UnlockCmd sets up the file 'unlock' subcommand

func UploadCmd

func UploadCmd() *cobra.Command

UploadCmd sets up the 'upload' subcommand

func UseRemoteCmd

func UseRemoteCmd() *cobra.Command

UseRemoteCmd sets up the 'use-remote' repository subcommand

func UseServerCmd

func UseServerCmd() *cobra.Command

UseServerCmd sets up the 'use-server' subcommand

func VersionCmd

func VersionCmd() *cobra.Command

VersionCmd sets up the 'version' subcommand

func Warn

func Warn(msg string)

Warn prints a warning message to stderr, logs it, and returns without interruption.

Types

type VersionInfo

type VersionInfo struct {
	Version string
	Build   string
	Commit  string
	Git     string
	Annex   string
}

VersionInfo holds the version numbers supplied by the linker flags in a convenient struct.

func (*VersionInfo) AnnexOK

func (v *VersionInfo) AnnexOK() (bool, error)

AnnexOK checks if the system annex version is higher than the required one. If it is not, or the git-annex binary is not found, an appropriate error message is returned.

func (*VersionInfo) GitOK

func (v *VersionInfo) GitOK() (bool, error)

GitOK checks if git runs and returns an understandable version string.

func (*VersionInfo) String

func (v *VersionInfo) String() string

String constructs a human-readable string that contains the version numbers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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