C# 클래스 SonarQube.Common.CommandLineParser

Process and validates the command line arguments and reports any errors
The command line parsing makes a number of simplifying assumptions: * order is unimportant * all arguments have a recognizable prefix e.g. /key= * the first matching prefix will be used (so if descriptors have overlapping prefixes they need to be supplied to the parser in the correct order on construction) * the command line arguments are those supplied in Main(args) i.e. they have been converted from a string to an array by the runtime. This means that quoted arguments will already have been partially processed so a command line of: myApp.exe "quoted arg" /k="ab cd" "" will be supplied as three args, [quoted arg] , [/k=ab cd] and String.Empty
파일 보기 프로젝트 열기: SonarSource-VisualStudio/sonarqube-roslyn-sdk 1 사용 예제들

공개 메소드들

메소드 설명
CommandLineParser ( IEnumerable descriptors, bool allowUnrecognized ) : System

Constructs a command line parser

ParseArguments ( string commandLineArgs, ILogger logger, IEnumerable &argumentInstances ) : bool

Parses the supplied arguments. Logs errors for unrecognized, duplicate or missing arguments.

비공개 메소드들

메소드 설명
CheckRequiredArgumentsSupplied ( IEnumerable arguments, ILogger logger ) : bool

Checks whether any required arguments are missing and logs error messages for them.

IdExists ( string id, IEnumerable arguments ) : bool
TryGetMatchingDescriptor ( string argument, SonarQube.Common.ArgumentDescriptor &descriptor, string &prefix ) : bool

Attempts to find a descriptor for the current argument

TryGetMatchingPrefix ( SonarQube.Common.ArgumentDescriptor descriptor, string argument ) : string

메소드 상세

CommandLineParser() 공개 메소드

Constructs a command line parser
public CommandLineParser ( IEnumerable descriptors, bool allowUnrecognized ) : System
descriptors IEnumerable List of descriptors that specify the valid argument types
allowUnrecognized bool True if unrecognized arguments should be ignored
리턴 System

ParseArguments() 공개 메소드

Parses the supplied arguments. Logs errors for unrecognized, duplicate or missing arguments.
public ParseArguments ( string commandLineArgs, ILogger logger, IEnumerable &argumentInstances ) : bool
commandLineArgs string
logger ILogger
argumentInstances IEnumerable A list of argument instances that have been recognized
리턴 bool