Command 클래스

정의

애플리케이션이 수행하는 특정 작업을 나타냅니다.

public ref class Command : System::CommandLine::IdentifierSymbol, System::Collections::Generic::IEnumerable<System::CommandLine::Symbol ^>
public class Command : System.CommandLine.IdentifierSymbol, System.Collections.Generic.IEnumerable<System.CommandLine.Symbol>
type Command = class
    inherit IdentifierSymbol
    interface seq<Symbol>
    interface IEnumerable
Public Class Command
Inherits IdentifierSymbol
Implements IEnumerable(Of Symbol)
상속
파생
구현

설명

특정 문자열(명령 이름)에 해당하는 작업에는 Command 개체를 사용합니다. 하나의 작업만 있는 간단한 애플리케이션은 를 참조하세요 RootCommand . 예를 들어 은 dotnet run 을 명령으로 사용합니다 run .

생성자

Command(String, String)

명령 클래스의 새 인스턴스를 초기화합니다.

속성

Aliases

명령줄에서 기호를 지정하는 데 사용할 수 있는 문자열 집합을 가져옵니다.

(다음에서 상속됨 IdentifierSymbol)
Arguments

명령에 대한 모든 인수를 나타냅니다.

Children

자식 기호를 가져옵니다.

Description

기호에 대한 설명을 가져오거나 설정합니다.

(다음에서 상속됨 Symbol)
Handler

명령에 대한 를 ICommandHandler 가져오거나 설정합니다. 처리기는 명령이 호출될 때 수행되는 작업을 나타냅니다.

IsHidden

기호가 숨겨져 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 Symbol)
Name

기호 이름을 가져오거나 설정합니다.

(다음에서 상속됨 IdentifierSymbol)
Options

명령의 상위 항목에 적용된 전역 옵션을 포함하여 명령에 대한 모든 옵션을 나타냅니다.

Parents

부모 기호를 가져옵니다.

(다음에서 상속됨 Symbol)
Subcommands

명령에 대한 모든 하위 명령을 나타냅니다.

TreatUnmatchedTokensAsErrors

일치하지 않는 토큰을 오류로 처리해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다. 예를 들어 로 설정 true 되고 추가 명령 또는 인수가 제공되면 유효성 검사가 실패합니다.

메서드

Add(Argument)

명령에 를 Argument 추가합니다.

Add(Command)

명령에 하위 명령을 추가합니다.

Add(Option)

명령에 를 Option 추가합니다.

AddAlias(String)

별칭을 추가합니다.

(다음에서 상속됨 IdentifierSymbol)
AddArgument(Argument)

명령에 를 Argument 추가합니다.

AddCommand(Command)

명령에 하위 명령을 추가합니다.

AddGlobalOption(Option)

명령에 전역 Option 을 추가합니다.

AddOption(Option)

명령에 를 Option 추가합니다.

AddValidator(ValidateSymbolResult<CommandResult>)

명령에 사용자 지정 유효성 검사기를 추가합니다. 유효성 검사기를 사용하여 사용자 지정 유효성 검사 논리를 만들 수 있습니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetCompletions()

기호에 대한 완성을 가져옵니다.

(다음에서 상속됨 Symbol)
GetCompletions(CompletionContext)

명령줄 완성을 위해 제안된 값을 가져옵니다.

GetEnumerator()

명령에 대한 모든 기호를 나타내는 열거자를 가져옵니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
HasAlias(String)

별칭이 이미 정의되었는지 여부를 확인합니다.

(다음에서 상속됨 IdentifierSymbol)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Symbol)

명시적 인터페이스 구현

IEnumerable.GetEnumerator()

컬렉션을 반복하는 열거자를 반환합니다.

확장 메서드

Invoke(Command, String, IConsole)

명령을 구문 분석하고 호출합니다.

Invoke(Command, String[], IConsole)

명령을 구문 분석하고 호출합니다.

InvokeAsync(Command, String, IConsole)

명령을 구문 분석하고 호출합니다.

InvokeAsync(Command, String[], IConsole)

명령을 구문 분석하고 호출합니다.

Parse(Command, String)

지정된 명령을 사용하여 명령줄 문자열 값을 구문 분석합니다.

Parse(Command, String[])

지정된 명령을 사용하여 배열 문자열을 구문 분석합니다.

SetHandler(Command, Action)

를 기반으로 Action명령의 처리기를 설정합니다.

SetHandler(Command, Func<Task>)

를 기반으로 Func<TResult>명령의 처리기를 설정합니다.

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

를 기반으로 Action<T>명령의 처리기를 설정합니다.

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

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>명령의 처리기를 설정합니다.

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[])

를 기반으로 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[])

를 기반으로 Action<T1,T2>명령의 처리기를 설정합니다.

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

를 기반으로 Func<T1,T2,TResult>명령의 처리기를 설정합니다.

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

를 기반으로 Action<T1,T2,T3>명령의 처리기를 설정합니다.

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

를 기반으로 Func<T1,T2,T3,TResult>명령의 처리기를 설정합니다.

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

를 기반으로 Action<T1,T2,T3,T4>명령의 처리기를 설정합니다.

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

를 기반으로 Func<T1,T2,T3,T4,TResult>명령의 처리기를 설정합니다.

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

를 기반으로 Action<T1,T2,T3,T4,T5>명령의 처리기를 설정합니다.

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

를 기반으로 Func<T1,T2,T3,T4,T5,TResult>명령의 처리기를 설정합니다.

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

를 기반으로 Action<T1,T2,T3,T4,T5,T6>명령의 처리기를 설정합니다.

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

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7>명령의 처리기를 설정합니다.

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

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8>명령의 처리기를 설정합니다.

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

를 기반으로 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[])

를 기반으로 Action<T1,T2,T3,T4,T5,T6,T7,T8,T9>명령의 처리기를 설정합니다.

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

를 기반으로 Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,TResult>명령의 처리기를 설정합니다.

적용 대상