cli

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package cli implements command line interface for CIPD client.

Its main exported function is GetApplication(...) that takes a bundle with default parameters and returns a *cli.Application configured with this defaults.

There's also Main(...) that does some additional arguments manipulation. It can be used to build a copy of 'cipd' tool with some defaults tweaked.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApplication

func GetApplication(params Parameters) *cli.Application

GetApplication returns cli.Application.

It can be used directly by subcommands.Run(...), or nested into another application.

func Main

func Main(params Parameters, args []string) int

Main runs the CIPD CLI.

It's like subcommands.Run(GetApplication(...), args) except it allows flag arguments and positional arguments to be mixed, which makes some CIPD subcommand invocations look more natural.

Compare:

  • Default: cipd set-ref -ref=abc -version=def package/name
  • Improved: cipd set-ref package/name -ref=abc -version=def

Much better.

Types

type Parameters

type Parameters struct {
	// DefaultAuthOptions provide default values for authentication related
	// options (most notably SecretsDir: a directory with token cache).
	DefaultAuthOptions auth.Options

	// ServiceURL is a backend URL to use by default.
	ServiceURL string
}

Parameters carry default configuration values for a CIPD CLI client.

Jump to

Keyboard shortcuts

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