RootCommand Classe

Definizione

Rappresenta l'azione principale eseguita dall'applicazione.

public ref class RootCommand : System::CommandLine::Command
public class RootCommand : System.CommandLine.Command
type RootCommand = class
    inherit Command
Public Class RootCommand
Inherits Command
Ereditarietà

Commenti

Usare l'oggetto RootCommand senza sottocomandi per le applicazioni che eseguono un'azione. Aggiungere sottocomandi alla radice per le applicazioni che richiedono azioni identificate da stringhe specifiche. Ad esempio, 'dir' non usa sottocomandi. Vedere Command per le applicazioni con più azioni.

Costruttori

RootCommand(String)

Rappresenta l'azione principale eseguita dall'applicazione.

Proprietà

Aliases

Ottiene il set di stringhe che possono essere usate nella riga di comando per specificare il simbolo.

(Ereditato da IdentifierSymbol)
Arguments

Rappresenta tutti gli argomenti per il comando.

(Ereditato da Command)
Children

Ottiene i simboli figlio.

(Ereditato da Command)
Description

Ottiene o imposta la descrizione del simbolo.

(Ereditato da Symbol)
ExecutableName

Nome dell'eseguibile attualmente in esecuzione.

ExecutablePath

Percorso dell'eseguibile attualmente in esecuzione.

Handler

Ottiene o imposta l'oggetto ICommandHandler per il comando. Il gestore rappresenta l'azione che verrà eseguita quando viene richiamato il comando.

(Ereditato da Command)
IsHidden

Ottiene o imposta un valore che indica se il simbolo è nascosto.

(Ereditato da Symbol)
Name

Ottiene o imposta il nome del simbolo.

(Ereditato da IdentifierSymbol)
Options

Rappresenta tutte le opzioni per il comando, incluse le opzioni globali applicate a uno dei predecessori del comando.

(Ereditato da Command)
Parents

Ottiene i simboli padre.

(Ereditato da Symbol)
Subcommands

Rappresenta tutti i sottocomandi per il comando.

(Ereditato da Command)
TreatUnmatchedTokensAsErrors

Ottiene o imposta un valore che indica se i token non corrispondenti devono essere considerati errori. Ad esempio, se impostato su true e viene fornito un comando o un argomento aggiuntivo, la convalida avrà esito negativo.

(Ereditato da Command)

Metodi

Add(Argument)

Aggiunge un Argument oggetto al comando.

(Ereditato da Command)
Add(Command)

Aggiunge un sottocomand al comando.

(Ereditato da Command)
Add(Option)

Aggiunge un Option oggetto al comando.

(Ereditato da Command)
AddAlias(String)

Aggiunge un alias.

(Ereditato da IdentifierSymbol)
AddArgument(Argument)

Aggiunge un Argument oggetto al comando.

(Ereditato da Command)
AddCommand(Command)

Aggiunge un sottocomand al comando.

(Ereditato da Command)
AddGlobalOption(Option)

Aggiunge un valore globale Option al comando.

(Ereditato da Command)
AddOption(Option)

Aggiunge un Option oggetto al comando.

(Ereditato da Command)
AddValidator(ValidateSymbolResult<CommandResult>)

Aggiunge un validator personalizzato al comando. I validator possono essere usati per creare la logica di convalida personalizzata.

(Ereditato da Command)
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetCompletions()

Ottiene i completamento per il simbolo.

(Ereditato da Symbol)
GetCompletions(CompletionContext)

Ottiene i valori suggeriti per il completamento della riga di comando.

(Ereditato da Command)
GetEnumerator()

Ottiene un enumeratore che rappresenta tutti i simboli per il comando.

(Ereditato da Command)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
HasAlias(String)

Determina se l'alias è già stato definito.

(Ereditato da IdentifierSymbol)
MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Symbol)

Implementazioni dell'interfaccia esplicita

IEnumerable.GetEnumerator()

Restituisce un enumeratore che consente di eseguire l'iterazione di una raccolta.

(Ereditato da Command)

Metodi di estensione

Invoke(Command, String, IConsole)

Analizza e richiama un comando.

Invoke(Command, String[], IConsole)

Analizza e richiama un comando.

InvokeAsync(Command, String, IConsole)

Analizza e richiama un comando.

InvokeAsync(Command, String[], IConsole)

Analizza e richiama un comando.

Parse(Command, String)

Analizza un valore stringa della riga di comando usando il comando specificato.

Parse(Command, String[])

Analizza le stringhe di matrice usando il comando specificato.

SetHandler(Command, Action)

Imposta il gestore di un comando in base a un Actionoggetto .

SetHandler(Command, Func<Task>)

Imposta il gestore di un comando in base a .Func<TResult>

SetHandler<T>(Command, Action<T>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T>oggetto .

SetHandler<T>(Command, Func<T,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15, T16>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13, T14,T15,T16>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15, T16>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13, T14,T15,T16,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult>

SetHandler<T1,T2>(Command, Action<T1,T2>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2>oggetto .

SetHandler<T1,T2>(Command, Func<T1,T2,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,TResult>

SetHandler<T1,T2,T3>(Command, Action<T1,T2,T3>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3>oggetto .

SetHandler<T1,T2,T3>(Command, Func<T1,T2,T3,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,TResult>

SetHandler<T1,T2,T3,T4>(Command, Action<T1,T2,T3,T4>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4>oggetto .

SetHandler<T1,T2,T3,T4>(Command, Func<T1,T2,T3,T4,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,TResult>

SetHandler<T1,T2,T3,T4,T5>(Command, Action<T1,T2,T3,T4,T5>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5>oggetto .

SetHandler<T1,T2,T3,T4,T5>(Command, Func<T1,T2,T3,T4,T5,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,TResult>

SetHandler<T1,T2,T3,T4,T5,T6>(Command, Action<T1,T2,T3,T4,T5,T6>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6>(Command, Func<T1,T2,T3,T4,T5,T6,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7>(Command, Action<T1,T2,T3,T4,T5,T6,T7>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7>(Command, Func<T1,T2,T3,T4,T5,T6,T7,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,TResult>

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9>(Command, Action<T1,T2,T3,T4,T5,T6,T7,T8,T9>, IValueDescriptor[])

Imposta il gestore di un comando in base a un Action<T1,T2,T3,T4,T5,T6,T7,T8,T9>oggetto .

SetHandler<T1,T2,T3,T4,T5,T6,T7,T8,T9>(Command, Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,Task>, IValueDescriptor[])

Imposta il gestore di un comando in base a .Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,TResult>

Si applica a