arguments
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func AddKeyValuePFlag(cmd *cobra.Command, field *map[string]string, name, shorthand string, ...)
- func AskForUserFields(userFields []*rpc.UserField) (map[string]string, error)
- func CalculateFQBNAndPort(ctx context.Context, portArgs *Port, fqbnArg *Fqbn, instance *rpc.Instance, ...) (string, *rpc.Port)
- func CheckFlagsConflicts(command *cobra.Command, flagNames ...string)
- func CheckFlagsMandatory(command *cobra.Command, flagNames ...string)
- func GetAvailablePorts(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []*rpc.Port
- func GetInstallableCores(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetInstallableLibs(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetInstalledBoards(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetInstalledLibraries(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetInstalledProgrammers(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetSketchProfiles(ctx context.Context, srv rpc.ArduinoCoreServiceServer, sketchPath string) []string
- func GetUninstallableCores(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func GetUninstallableLibraries(ctx context.Context, srv rpc.ArduinoCoreServiceServer) []string
- func InitSketchPath(path string) (sketchPath *paths.Path)
- type DiscoveryTimeout
- type Fqbn
- type Port
- func (p *Port) AddToCommand(cmd *cobra.Command, srv rpc.ArduinoCoreServiceServer)
- func (p *Port) DetectFQBN(ctx context.Context, inst *rpc.Instance, srv rpc.ArduinoCoreServiceServer) (string, *rpc.Port, error)
- func (p *Port) GetPort(ctx context.Context, instance *rpc.Instance, srv rpc.ArduinoCoreServiceServer, ...) (*rpc.Port, error)
- func (p *Port) GetPortAddressAndProtocol(ctx context.Context, instance *rpc.Instance, srv rpc.ArduinoCoreServiceServer, ...) (string, string, error)
- func (p *Port) GetSearchTimeout() time.Duration
- func (p *Port) IsPortFlagSet() bool
- type PrePostScriptsFlags
- func (p *PrePostScriptsFlags) AddToCommand(cmd *cobra.Command)
- func (p *PrePostScriptsFlags) DetectSkipPostInstallValue() bool
- func (p *PrePostScriptsFlags) DetectSkipPreUninstallValue() bool
- func (p *PrePostScriptsFlags) GetRunPostInstall() bool
- func (p *PrePostScriptsFlags) GetRunPreUninstall() bool
- func (p *PrePostScriptsFlags) GetSkipPostInstall() bool
- func (p *PrePostScriptsFlags) GetSkipPreUninstall() bool
- type Profile
- type Programmer
- type Reference
- type ShowProperties
- type ShowPropertiesMode
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcAddKeyValuePFlag¶
func AddKeyValuePFlag(cmd *cobra.Command, field *map[string]string, name, shorthandstring, value []string, usagestring)
AddKeyValuePFlag adds a flag to the command that accepts a (possibly repeated) key=value pair.
funcAskForUserFields¶
AskForUserFields prompts the user to input the provided user fields.If there is an error reading input it panics.
funcCalculateFQBNAndPort¶
func CalculateFQBNAndPort(ctxcontext.Context, portArgs *Port, fqbnArg *Fqbn, instance *rpc.Instance, srvrpc.ArduinoCoreServiceServer, defaultFQBN, defaultAddress, defaultProtocolstring, profile *rpc.SketchProfile) (string, *rpc.Port)
CalculateFQBNAndPort calculate the FQBN and Port metadata based onparameters provided by the user.This determine the FQBN based on:- the value of the FQBN flag if explicitly specified, otherwise- the FQBN of the selected profile if available, otherwise- the default FQBN value in sketch.yaml (`default_fqbn` key) if available, otherwise- it tries to autodetect the board connected to the given port flagsIf all above methods fails, it returns the empty string.The Port metadata are always returned except if:
- the port is not found, in this case nil is returned
- the FQBN autodetection fail, in this case the function prints an error andterminates the execution
funcCheckFlagsConflicts¶
CheckFlagsConflicts is a helper function useful to report errors when more than one conflicting flag is used
funcCheckFlagsMandatory¶
CheckFlagsMandatory is a helper function useful to report errors when at least one flag is not used in a group of "required" flags
funcGetAvailablePorts¶
GetAvailablePorts is an helper function useful to autocomplete.It returns a list of upload port of the boards which are currently connected.It will not suggests network ports because the timeout is not set.
funcGetInstallableCores¶
func GetInstallableCores(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetInstallableCores is an helper function useful to autocomplete.It returns a list of cores which can be installed/downloaded
funcGetInstallableLibs¶
func GetInstallableLibs(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetInstallableLibs is an helper function useful to autocomplete.It returns a list of libs which can be installed/downloaded
funcGetInstalledBoards¶
func GetInstalledBoards(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetInstalledBoards is an helper function useful to autocomplete.It returns a list of fqbnit's taken from cli/board/listall.go
funcGetInstalledLibraries¶
func GetInstalledLibraries(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetInstalledLibraries is an helper function useful to autocomplete.It returns a list of libs which are currently installed, including the builtin ones
funcGetInstalledProgrammers¶
func GetInstalledProgrammers(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetInstalledProgrammers is an helper function useful to autocomplete.It returns a list of programmers available based on the installed boards
funcGetSketchProfiles¶added inv1.0.0
func GetSketchProfiles(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer, sketchPathstring) []string
GetSketchProfiles is an helper function useful to autocomplete.It returns the profile names set in the sketch.yaml
funcGetUninstallableCores¶
func GetUninstallableCores(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetUninstallableCores is an helper function useful to autocomplete.It returns a list of cores which can be uninstalled
funcGetUninstallableLibraries¶
func GetUninstallableLibraries(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer) []string
GetUninstallableLibraries is an helper function useful to autocomplete.It returns a list of libs which can be uninstalled
funcInitSketchPath¶
func InitSketchPath(pathstring) (sketchPath *paths.Path)
InitSketchPath returns an instance of paths.Path pointing to sketchPath.If sketchPath is an empty string returns the current working directory.
Types¶
typeDiscoveryTimeout¶
type DiscoveryTimeout struct {// contains filtered or unexported fields}DiscoveryTimeout is the timeout given to discoveries to detect ports.
func (*DiscoveryTimeout)AddToCommand¶
func (d *DiscoveryTimeout) AddToCommand(cmd *cobra.Command)
AddToCommand adds the flags used to set fqbn to the specified Command
typeFqbn¶
type Fqbn struct {// contains filtered or unexported fields}Fqbn contains the fqbn flag data.This is useful so all flags used by commands that needthis information are consistent with each other.
func (*Fqbn)AddToCommand¶
func (f *Fqbn) AddToCommand(cmd *cobra.Command, srvrpc.ArduinoCoreServiceServer)
AddToCommand adds the flags used to set fqbn to the specified Command
typePort¶
type Port struct {// contains filtered or unexported fields}Port contains the port arguments result.This is useful so all flags used by commands that needthis information are consistent with each other.
func (*Port)AddToCommand¶
func (p *Port) AddToCommand(cmd *cobra.Command, srvrpc.ArduinoCoreServiceServer)
AddToCommand adds the flags used to set port and protocol to the specified Command
func (*Port)DetectFQBN¶
func (p *Port) DetectFQBN(ctxcontext.Context, inst *rpc.Instance, srvrpc.ArduinoCoreServiceServer) (string, *rpc.Port,error)
DetectFQBN tries to identify the board connected to the port and returns thediscovered Port object together with the FQBN. If the port does not matchexactly 1 board,
func (*Port)GetPort¶
func (p *Port) GetPort(ctxcontext.Context, instance *rpc.Instance, srvrpc.ArduinoCoreServiceServer, defaultAddress, defaultProtocolstring, profile *rpc.SketchProfile) (*rpc.Port,error)
GetPort returns the Port obtained by parsing command line arguments.The extra metadata for the ports is obtained using the pluggable discoveries.
func (*Port)GetPortAddressAndProtocol¶
func (p *Port) GetPortAddressAndProtocol(ctxcontext.Context, instance *rpc.Instance, srvrpc.ArduinoCoreServiceServer, defaultAddress, defaultProtocolstring, profile *rpc.SketchProfile) (string,string,error)
GetPortAddressAndProtocol returns only the port address and the port protocolwithout any other port metadata obtained from the discoveries.This method allows will bypass the discoveries if:- a nil instance is passed: in this case the plain port and protocol arguments are returned (even if empty)- a protocol is specified: in this case the discoveries are not needed to autodetect the protocol.
func (*Port)GetSearchTimeout¶
GetSearchTimeout returns the timeout
func (*Port)IsPortFlagSet¶added inv1.0.0
IsPortFlagSet returns true if the port address is provided
typePrePostScriptsFlags¶
type PrePostScriptsFlags struct {// contains filtered or unexported fields}PrePostScriptsFlags contains flags data used by the core install and the upgrade commandThis is useful so all flags used by commands that needthis information are consistent with each other.
func (*PrePostScriptsFlags)AddToCommand¶
func (p *PrePostScriptsFlags) AddToCommand(cmd *cobra.Command)
AddToCommand adds flags that can be used to force running or skippingof post installation scripts
func (*PrePostScriptsFlags)DetectSkipPostInstallValue¶
func (p *PrePostScriptsFlags) DetectSkipPostInstallValue()bool
DetectSkipPostInstallValue returns true if a post install script must be run
func (*PrePostScriptsFlags)DetectSkipPreUninstallValue¶
func (p *PrePostScriptsFlags) DetectSkipPreUninstallValue()bool
DetectSkipPreUninstallValue returns true if a post install script must be run
func (*PrePostScriptsFlags)GetRunPostInstall¶
func (p *PrePostScriptsFlags) GetRunPostInstall()bool
GetRunPostInstall returns the run-post-install flag value
func (*PrePostScriptsFlags)GetRunPreUninstall¶
func (p *PrePostScriptsFlags) GetRunPreUninstall()bool
GetRunPreUninstall returns the run-post-install flag value
func (*PrePostScriptsFlags)GetSkipPostInstall¶
func (p *PrePostScriptsFlags) GetSkipPostInstall()bool
GetSkipPostInstall returns the skip-post-install flag value
func (*PrePostScriptsFlags)GetSkipPreUninstall¶
func (p *PrePostScriptsFlags) GetSkipPreUninstall()bool
GetSkipPreUninstall returns the skip-post-install flag value
typeProfile¶
type Profile struct {// contains filtered or unexported fields}Profile contains the profile flag data.This is useful so all flags used by commands that needthis information are consistent with each other.
func (*Profile)AddToCommand¶
func (f *Profile) AddToCommand(cmd *cobra.Command, srvrpc.ArduinoCoreServiceServer)
AddToCommand adds the flags used to set fqbn to the specified Command
typeProgrammer¶
type Programmer struct {// contains filtered or unexported fields}Programmer contains the programmer flag data.This is useful so all flags used by commands that needthis information are consistent with each other.
func (*Programmer)AddToCommand¶
func (p *Programmer) AddToCommand(cmd *cobra.Command, srvrpc.ArduinoCoreServiceServer)
AddToCommand adds the flags used to set the programmer to the specified Command
func (*Programmer)GetProgrammer¶added inv1.0.0
func (p *Programmer) GetProgrammer()string
GetProgrammer returns the programmer specified by the user
typeReference¶
Reference represents a reference item (core or library) passed to the CLIinterface
funcParseReference¶
func ParseReference(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer, argstring) (*Reference,error)
ParseReference parses a string and returns a Reference object.It tries to infer the platform the user is asking for.To achieve that, it tries to use github.com/arduino/arduino-cli/commands/core.GetPlatformNote that the Reference is returned rightaway if the arg inserted by the user matches perfectly one in the response of core.GetPlatformA MultiplePlatformsError is returned if the platform searched by the user matches multiple platforms
funcParseReferences¶
func ParseReferences(ctxcontext.Context, srvrpc.ArduinoCoreServiceServer, args []string) ([]*Reference,error)
ParseReferences is a convenient wrapper that operates on a slice of strings andcalls ParseReference for each of them. It returns at the first invalid argument.
typeShowProperties¶
type ShowProperties struct {// contains filtered or unexported fields}ShowProperties represents the --show-properties flag.
func (*ShowProperties)AddToCommand¶
func (p *ShowProperties) AddToCommand(command *cobra.Command)
AddToCommand adds the --show-properties flag to the specified command.
func (*ShowProperties)Get¶
func (p *ShowProperties) Get() (ShowPropertiesMode,error)
Get returns the corresponding ShowProperties value.
typeShowPropertiesMode¶
type ShowPropertiesModeint
ShowPropertiesMode represents the possible values of the --show-properties flag.
const (// ShowPropertiesDisabled means that the --show-properties flag has not been usedShowPropertiesDisabledShowPropertiesMode =iota// ShowPropertiesUnexpanded means that the --show-properties flag has been used without a value or with the value "unexpanded"ShowPropertiesUnexpanded// ShowPropertiesExpanded means that the --show-properties flag has been used with the value "expanded"ShowPropertiesExpanded)