Show / Hide Table of Contents

Class CliMultiCommand

Common base class for commands that provide multiple sub-CliCommands.

Inheritance
Object
ServiceProvider
ScopedOperation
CliCommand
CliMultiCommand
CatalogMan
StoreMan
TrustMan
Self
Inherited Members
CliCommand.Options
CliCommand.AdditionalArgs
CliCommand.SupportedValues<T>(T[])
CliCommand.SupportedValues<T>()
CliCommand.FetchAll(IEnumerable<Implementation>)
CliCommand.AsParallel<T>(IEnumerable<T>)
CliCommand.Create(String, ICommandHandler)
CliCommand.CreateAndParse(IReadOnlyList<String>, ICommandHandler)
CliCommand.GetCommandName(IReadOnlyList<String>)
CliCommand.FullName
CliCommand.AdditionalArgsMax
CliCommand.HelpText
CliCommand.Handler
CliCommand.ImplementationsInReadOnlyStores
ScopedOperation.GetCanonicalUri(String)
ScopedOperation.GetCatalog()
ScopedOperation.FindByShortName(String)
ScopedOperation.BackgroundSelfUpdate()
ScopedOperation.StartCommandBackground(String, String[])
ScopedOperation.MinimumNetworkUseForBackgroundSelfUpdate
ServiceProvider.TrySolveOffline(Requirements)
ServiceProvider.Config
ServiceProvider.ImplementationStore
ServiceProvider.OpenPgp
ServiceProvider.FeedCache
ServiceProvider.TrustManager
ServiceProvider.FeedManager
ServiceProvider.CatalogManager
ServiceProvider.PackageManager
ServiceProvider.SelectionCandidateProvider
ServiceProvider.Solver
ServiceProvider.Fetcher
ServiceProvider.Executor
ServiceProvider.SelectionsManager
Namespace: ZeroInstall.Commands
Assembly: 0install.dll
Syntax
public abstract class CliMultiCommand : CliCommand

Constructors

CliMultiCommand(ICommandHandler)

Creates a new command.

Declaration
protected CliMultiCommand(ICommandHandler handler)
Parameters
Type Name Description
ICommandHandler handler

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

Properties

AdditionalArgsMin

Declaration
protected override int AdditionalArgsMin { get; }
Property Value
Type Description
Int32
Overrides
CliCommand.AdditionalArgsMin

Description

A short description of what this command does.

Declaration
public override string Description { get; }
Property Value
Type Description
String
Overrides
CliCommand.Description

SubCommandNames

A list of sub-command names (without alternatives) as used in command-line arguments in lower-case.

Declaration
public abstract IEnumerable<string> SubCommandNames { get; }
Property Value
Type Description
IEnumerable<String>

Usage

Declaration
public override string Usage { get; }
Property Value
Type Description
String
Overrides
CliCommand.Usage

Methods

Execute()

Executes the commands specified by the command-line arguments. Must call Parse(IReadOnlyList<String>) first!

Declaration
public override ExitCode Execute()
Returns
Type Description
ExitCode

The exit status code to end the process with.

Overrides
CliCommand.Execute()
Remarks

When inheriting this method is usually replaced.

Exceptions
Type Condition
OperationCanceledException

The user canceled the task.

NDesk.Options.OptionException

The number of arguments passed in on the command-line is incorrect.

WebException

A file could not be downloaded from the internet.

NotSupportedException

A file format, protocol, etc. is unknown or not supported.

IOException

A downloaded file could not be written to the disk or extracted or an external application or file required by the solver could not be accessed.

UnauthorizedAccessException

An operation failed due to insufficient rights.

InvalidDataException

A problem occurred while deserializing an XML file.

SignatureException

The signature data could not be handled for some reason.

FormatException

An URI, local path, version number, etc. is invalid.

DigestMismatchException

An Implementation's Archives don't match the associated ManifestDigest.

SolverException

The ISolver was unable to provide Selections that fulfill the Requirements.

ImplementationNotFoundException

One of the ImplementationBases is not cached yet.

ExecutorException

The IExecutor was unable to process the Selections.

GetCommand(String)

Creates a new sub-CliCommand based on a name.

Declaration
public abstract CliCommand GetCommand(string commandName)
Parameters
Type Name Description
String commandName

The command name to look for; case-insensitive.

Returns
Type Description
CliCommand

The requested sub-CliCommand.

Exceptions
Type Condition
NDesk.Options.OptionException

commandName is an unknown command.

IOException

There was a problem accessing a configuration file or one of the stores.

UnauthorizedAccessException

Access to a configuration file or one of the stores was not permitted.

InvalidDataException

A configuration file is damaged.

Parse(IReadOnlyList<String>)

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

Declaration
public override void Parse(IReadOnlyList<string> args)
Parameters
Type Name Description
IReadOnlyList<String> args

The command-line arguments to be parsed.

Overrides
CliCommand.Parse(IReadOnlyList<String>)
Exceptions
Type Condition
OperationCanceledException

The user asked to see help information, version information, etc..

NDesk.Options.OptionException

args contains unknown options.

IOException

An IO operation failed.

UnauthorizedAccessException

More privileges are required.

UriFormatException

The URI or local path specified is invalid.

In This Article
Back to top Copyright Bastian Eicher et al