Zero Install .NET API 2.20.0
ZeroInstall.Commands.Basic.Selection Class Reference

Select a version of the program identified by URI, and compatible versions of all of its dependencies. More...

Inheritance diagram for ZeroInstall.Commands.Basic.Selection:
ZeroInstall.Commands.CliCommand ZeroInstall.Commands.ScopedOperation ZeroInstall.Services.ServiceProvider ZeroInstall.Commands.Basic.Download ZeroInstall.Commands.Basic.Export ZeroInstall.Commands.Basic.Run ZeroInstall.Commands.Basic.Update ZeroInstall.Commands.Desktop.Self.Update

Public Member Functions

 Selection (ICommandHandler handler)
 Creates a new select command. More...
 
override void Parse (IEnumerable< string > args)
 Parses command-line arguments and stores the result in the command. More...
 
override ExitCode Execute ()
 Executes the commands specified by the command-line arguments. Must call Parse first! More...
 
- Public Member Functions inherited from ZeroInstall.Commands.ScopedOperation
FeedUri GetCanonicalUri (string uri)
 Converts an interface or feed URI to its canonical representation. More...
 
- Public Member Functions inherited from ZeroInstall.Services.ServiceProvider
 ServiceProvider (ITaskHandler handler)
 Creates a new service provider. More...
 

Static Public Attributes

const string Name = "select"
 The name of this command as used in command-line arguments in lower-case.
 

Protected Member Functions

 Selection (ICommandHandler handler, bool outputOptions=true, bool refreshOptions=true, bool customizeOptions=true)
 Creates a new select command. More...
 
void SetInterfaceUri (FeedUri uri)
 Sets Model.Requirements.InterfaceUri and applies Requirements options that need to be deferred to the end of the parsing process.
 
virtual void Solve ()
 Runs ISolver.Solve (unless SelectionsDocument is true) and stores the result in Selections. More...
 
void RefreshSolve ()
 Run Solve with IFeedManager.Refresh set to true.
 
void Show (Selections selections)
 Displays the selections to the user.
 
virtual ExitCode ShowOutput ()
 
- Protected Member Functions inherited from ZeroInstall.Commands.CliCommand
 CliCommand (ICommandHandler handler)
 Creates a new command. More...
 
void FetchAll (IEnumerable< Implementation > implementations)
 Downloads a set of Implementations to the Store in parallel. More...
 
ParallelQuery< T > AsParallel< T > (IEnumerable< T > elements)
 Prepares the elements for parallel processing while respecting Config.MaxParallelDownloads and ITaskHandler.CancellationToken.
 
- Protected Member Functions inherited from ZeroInstall.Commands.ScopedOperation
 ScopedOperation (ITaskHandler handler)
 Creates a new command base. More...
 
Catalog GetCatalog ()
 Returns a merged view of all Catalogs specified by the configuration files. More...
 
FeedFindByShortName (string shortName)
 Uses Catalog.FindByShortName to find a Feed matching a specific short name. More...
 
void SelfUpdateCheck ()
 Periodically checks Zero Install itself for updates in a background process.
 

Protected Attributes

bool SelectionsDocument
 Indicates the user provided a pre-computed Selections XML document instead of using the ISolver.
 
bool CustomizeSelections
 Indicates the user wants a UI to modify the Selections.
 
bool ShowXml
 Indicates the user wants a machine-readable output.
 
SelectionsSelections
 Cached ISolver results.
 
- Protected Attributes inherited from ZeroInstall.Commands.CliCommand
readonly List< string > AdditionalArgs = new()
 Feeds to add, terms to search for, etc.
 

Properties

override string Description [get]
 
override string Usage [get]
 
override int AdditionalArgsMin [get]
 
override int AdditionalArgsMax [get]
 
Requirements Requirements = new() [get]
 A set of requirements/restrictions imposed by the user on the implementation selection process as parsed from the command-line arguments.
 
- Properties inherited from ZeroInstall.Commands.CliCommand
string???? FullName [get]
 The full name of this command (including sub-commands) as used in command-line arguments in lower-case.
 
abstract string Description [get]
 A short description of what this command does.
 
abstract string Usage [get]
 The additional arguments to be displayed after the command name in the help text.
 
virtual int AdditionalArgsMin [get]
 The minimum number of AdditionalArgs allowed. Checked in Parse.
 
virtual int AdditionalArgsMax [get]
 The maximum number of AdditionalArgs allowed. Checked in Parse.
 
string HelpText [get]
 The help text describing the available command-line options and their effects.
 
new ICommandHandler Handler [get]
 A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
 
- Properties inherited from ZeroInstall.Services.ServiceProvider
virtual ITaskHandler Handler [get]
 A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
 
virtual Config Config [get]
 User settings controlling network behaviour, solving, etc.
 
virtual IImplementationStore ImplementationStore = ImplementationStores.Default() [getset]
 Describes an object that allows the storage and retrieval of Implementation directories.
 
virtual IOpenPgp OpenPgp = Store.Trust.OpenPgp.Verifying() [getset]
 Provides access to an encryption/signature system compatible with the OpenPGP standard.
 
virtual IFeedCache FeedCache [get]
 Provides access to a cache of Feeds that were downloaded via HTTP(S).
 
virtual ITrustManager TrustManager [get]
 Methods for verifying signatures and user trust.
 
virtual IFeedManager FeedManager [get]
 Allows configuration of the source used to request Feeds.
 
virtual ICatalogManager CatalogManager [get]
 Provides access to remote and local Catalogs. Handles downloading, signature verification and caching.
 
virtual IPackageManager PackageManager [get]
 An external package manager that can install PackageImplementations.
 
virtual ISelectionCandidateProvider SelectionCandidateProvider [get]
 Generates SelectionCandidates for the Solver to choose among.
 
virtual ISolver Solver [get]
 Chooses a set of Implementations to satisfy the requirements of a program and its user.
 
virtual IFetcher Fetcher [get]
 Used to download missing Implementations.
 
virtual IExecutor Executor [get]
 Executes a Selections document as a program using dependency injection.
 
virtual ISelectionsManager SelectionsManager [get]
 Provides methods for filtering Selections.
 

Additional Inherited Members

- Static Public Member Functions inherited from ZeroInstall.Commands.CliCommand
static CliCommand Create (string? commandName, ICommandHandler handler)
 Creates a new CliCommand based on a name. More...
 
static CliCommand CreateAndParse (IEnumerable< string > args, ICommandHandler handler)
 Parses command-line arguments, automatically creating an appropriate CliCommand. More...
 
static ? string GetCommandName (ref IEnumerable< string > args)
 Determines the command name specified in the command-line arguments. More...
 
- Static Protected Member Functions inherited from ZeroInstall.Commands.CliCommand
static string SupportedValues< T > (params T[] values)
 Generates a localized instruction string describing multiple selectable values. More...
 
static string SupportedValues< T > ()
 Generates a localized instruction string describing multiple selectable enum values. More...
 
- Static Protected Member Functions inherited from ZeroInstall.Commands.ScopedOperation
static void StartCommandBackground (string command, params string[] args)
 Starts executing a command in a background process. Returns immediately. More...
 
- Package Attributes inherited from ZeroInstall.Commands.CliCommand
readonly OptionSet Options = new()
 The command-line argument parser used to evaluate user input.
 
- Static Package Attributes inherited from ZeroInstall.Commands.CliCommand
static readonly string[] Names
 A list of command names (without alternatives) as used in command-line arguments in lower-case. More...
 

Detailed Description

Select a version of the program identified by URI, and compatible versions of all of its dependencies.

Constructor & Destructor Documentation

◆ Selection() [1/2]

ZeroInstall.Commands.Basic.Selection.Selection ( ICommandHandler  handler)
inline

Creates a new select command.

Parameters
handlerA callback object used when the the user needs to be asked questions or informed about download and IO tasks.

◆ Selection() [2/2]

ZeroInstall.Commands.Basic.Selection.Selection ( ICommandHandler  handler,
bool  outputOptions = true,
bool  refreshOptions = true,
bool  customizeOptions = true 
)
inlineprotected

Creates a new select command.

Parameters
handlerA callback object used when the the user needs to be asked questions or informed about download and IO tasks.
outputOptionsWhether to add command-line options controlling output.
refreshOptionsWhether to add command-line options controlling refresh behavior.
customizeOptionsWhether to add command-line options for customizing selected implementations.

Member Function Documentation

◆ Execute()

override ExitCode ZeroInstall.Commands.Basic.Selection.Execute ( )
inlinevirtual

Executes the commands specified by the command-line arguments. Must call Parse first!

Implements ZeroInstall.Commands.CliCommand.

Reimplemented in ZeroInstall.Commands.Basic.Update, and ZeroInstall.Commands.Desktop.Self.Update.

◆ Parse()

override void ZeroInstall.Commands.Basic.Selection.Parse ( IEnumerable< string >  args)
inlinevirtual

Parses command-line arguments and stores the result in the command.

Reimplemented from ZeroInstall.Commands.CliCommand.

Reimplemented in ZeroInstall.Commands.Desktop.Self.Update.

◆ ShowOutput()

virtual ExitCode ZeroInstall.Commands.Basic.Selection.ShowOutput ( )
inlineprotectedvirtual

◆ Solve()

virtual void ZeroInstall.Commands.Basic.Selection.Solve ( )
inlineprotectedvirtual

Runs ISolver.Solve (unless SelectionsDocument is true) and stores the result in Selections.

Returns
The same result as stored in Selections.
Exceptions
OperationCanceledExceptionThe user canceled the task.
WebExceptionA file could not be downloaded from the internet.
IOExceptionAn external application or file required by the solver could not be accessed.
SolverExceptionThe ISolver was unable to provide Selections that fulfill the Requirements.

Reimplemented in ZeroInstall.Commands.Basic.Download, ZeroInstall.Commands.Basic.Export, and ZeroInstall.Commands.Basic.Run.


The documentation for this class was generated from the following file: