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 ¶
- func AddRemoteCmd() *cobra.Command
- func AddServerCmd() *cobra.Command
- func AnnexCmd() *cobra.Command
- func CheckError(err error)
- func CheckErrorMsg(err error, msg string)
- func CommitCmd() *cobra.Command
- func CreateCmd() *cobra.Command
- func DeleteCmd() *cobra.Command
- func Die(msg interface{})
- func DownloadCmd() *cobra.Command
- func Exit(msg string)
- func GetCmd() *cobra.Command
- func GetContentCmd() *cobra.Command
- func GitCmd() *cobra.Command
- func InfoCmd() *cobra.Command
- func InitCmd() *cobra.Command
- func KeysCmd() *cobra.Command
- func LockCmd() *cobra.Command
- func LoginCmd() *cobra.Command
- func LogoutCmd() *cobra.Command
- func LsRepoCmd() *cobra.Command
- func RemotesCmd() *cobra.Command
- func RemoveContentCmd() *cobra.Command
- func RemoveRemoteCmd() *cobra.Command
- func RemoveServerCmd() *cobra.Command
- func RepoInfoCmd() *cobra.Command
- func ReposCmd() *cobra.Command
- func ServersCmd() *cobra.Command
- func SetUpCommands(verinfo VersionInfo) *cobra.Command
- func SyncCmd() *cobra.Command
- func UnlockCmd() *cobra.Command
- func UploadCmd() *cobra.Command
- func UseRemoteCmd() *cobra.Command
- func UseServerCmd() *cobra.Command
- func VersionCmd() *cobra.Command
- func Warn(msg string)
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRemoteCmd ¶
AddRemoteCmd sets up the 'add-remote' repository subcommand
func AddServerCmd ¶
AddServerCmd sets up the 'add-server' command for adding new server configurations
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 ¶
CheckErrorMsg exits the program if an error is passed to the function. Before exiting, the given msg string is printed to stderr.
func Die ¶
func Die(msg interface{})
Die prints an error message to stderr and exits the program with status 1.
func Exit ¶
func Exit(msg string)
Exit prints a message to stdout and exits the program with status 0.
func GetContentCmd ¶
GetContentCmd sets up the 'get-content' subcommand
func RemoveContentCmd ¶
RemoveContentCmd sets up the 'remove-content' subcommand
func RemoveRemoteCmd ¶
RemoveRemoteCmd sets up the 'remove-remote' repository subcommand
func RemoveServerCmd ¶
RemoveServerCmd sets up the 'remove-server' repository subcommand
func RepoInfoCmd ¶
RepoInfoCmd sets up the 'repoinfo' listing 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 UseRemoteCmd ¶
UseRemoteCmd sets up the 'use-remote' repository subcommand
func UseServerCmd ¶
UseServerCmd sets up the 'use-server' subcommand
Types ¶
type VersionInfo ¶
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.
Source Files ¶
- addremotecmd.go
- addservercmd.go
- annexcmd.go
- cliversion.go
- commitcmd.go
- common.go
- createcmd.go
- deletecmd.go
- downloadcmd.go
- getcmd.go
- getcontentcmd.go
- gitcmd.go
- helptemplate.go
- infocmd.go
- initcmd.go
- keyscmd.go
- lockcmd.go
- logincmd.go
- logoutcmd.go
- lscmd.go
- pkgdoc.go
- remotescmd.go
- removecontentcmd.go
- removeremotecmd.go
- removeservercmd.go
- repoinfocmd.go
- reposcmd.go
- serverscmd.go
- synccmd.go
- unlockcmd.go
- uploadcmd.go
- useremotecmd.go
- useservercmd.go
- versioncmd.go