A command line object that parse from the user input commandline string. (从用户所输入的命令行字符串之中解析出来的命令行对象,标准的命令行格式为: <EXE> <CLI_Name> ["Parameter" "Value"])
CommandLine
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| HavebFlag | 1 | See if the target logical flag argument is exists in the commandline? |
| ToString | 1 | Returns the original cli command line argument string. |
| GetFullDIRPath | 1 | Get specific argument value as full directory path. |
| GetFullFilePath | 1 | Get specific argument value as full file path. |
| CheckMissingRequiredParameters | 1 | Checking for the missing required parameter, this function will returns the missing parameter in the current cli command line object using a specific parameter name list. |
| CheckMissingRequiredArguments | 1 | Gets a list of missing required argument name. |
| ContainsParameter | 1 | Does the specific argument exists in this commandline? argument name is not case sensitity. |
| op_Implicit | 1 | Parsing the commandline string as object model |
| Assert | 1 | Determined that the specific Boolean flag is exists or not? if not then returns failure, if exists such flag, then returns the name. |
| GetDictionary | 1 | If the target parameter is not presents in the CLI, then this function will returns nothing. |
| IsTrue | 1 | Gets the value Of the specified column As a Boolean. |
| OpenStreamInput | 1 | About s: + If the file path is not a value path, then is the value is not null, the argument value will be returned from this parameter. |
| OpenStreamOutput | 1 | If the StreamWriter.BaseStream is FileStream, then it means not a std_out pointer. |
| ReadInput | 1 | Read all of the text input from the file or std_in |
| GetOrdinal | 1 | Return the index Of the named field. |
| GetString | 1 | Gets the String value Of the specified argument. |
| GetObject | 1 | |
| GetValue | 1 | If the given parameter is not exists in the user input arguments, then a developer specific default value will be return. |
| OpenHandle | 1 | Open a file handle by using the parameter value |
| GetEnumerator | 1 | 这个枚举函数也会将开关给包含进来,与CommandLine.ToArgumentVector()方法所不同的是,这个函数里面的逻辑值开关的名称没有被修饰剪裁 |
| Add | 2 | Adds an item to the System.Collections.Generic.ICollection1. |
| Clear | 1 | Clear the inner list buffer |
| Contains | 1 | 只是通过比较名称来判断是否存在,值没有进行比较 |
| Remove | 2 | Removes a parameter by NamedValue.Name |
| ToArgumentVector | 1 | 将当前的这个命令行对象之中的所有的参数值都合并到一个向量之中返回. |
| op_Addition | 1 | Open a handle for a file system object. |
| op_LessThanOrEqual | 1 | Gets the CLI parameter value. |
| op_Subtraction | 2 | Try get parameter value. |
| TrimNamePrefix | 1 | |
| Required | 1 | |
| GetObject | 1 | |
| GetValue | 1 | |
| GetEnumerator1 | 1 | |
| CopyTo | 1 | |
| CreateOpts | 1 | |
| op_Exponent | 1 | |
| op_GreaterThanOrEqual | 1 | |
| op_UnaryNegation | 1 | |
| op_GreaterThan | 1 | |
| op_LessThan | 1 | |
| Parse | 1 | |
| ParseTokens | 1 | |
| BuildFromArguments | 1 | |
| GetDataReader | 1 |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| Name | 1 | The command name that parse from the input command line. |
| Tokens | 1 | The command tokens that were parsed from the input commandline. |
| ParameterList | 1 | Listing all of the parameter value collection that parsed from the commandline string. |
| Keys | 1 | 得到当前的命令行对象之中的所有的参数的名称的列表 |
| Parameters | 1 | The parameters in the commandline without the first token of the command name. |
| BoolFlags | 1 | 对于参数而言,都是--或者-或者/或者\开头的,下一个单词为单引号或者非上面的字符开头的,例如/o <path> 对于开关而言,与参数相同的其实符号,但是后面不跟参数而是其他的开关,通常开关用来进行简要表述一个逻辑值 |
| EnvironmentVariables | 1 | 获取得到通过/@set参数所传入的环境变量(键值对之间使用分号分隔) |
| cli | 1 | Get the original command line string. |
| Item | 1 | The parameter name is not case sensitive. |
| IsNullOrEmpty | 1 | Does this cli command line object contains any parameter argument information. |
| IsNothing | 1 | String of CommandLine.Name AndAlso CommandLine.IsNullOrEmpty |
| Count | 1 | Get the switch counts in this commandline object.(获取本命令行对象中的所定义的开关的数目) |
| SingleValue | 1 |
04 Fields
| Name | Overloads | Summary |
|---|---|---|
| cliCommandArgvs | 1 | 原始的命令行字符串 |
05 Members
String)See if the target logical flag argument is exists in the commandline?
| Name | Type | Description |
|---|---|---|
name | String | - |
(查看命令行之中是否存在某一个逻辑开关)
Returns the original cli command line argument string.
(返回所传入的命令行的原始字符串)
String)Get specific argument value as full directory path.
| Name | Type | Description |
|---|---|---|
name | String | parameter name |
String)Get specific argument value as full file path.
(这个函数还会同时修正file://协议的头部)
| Name | Type | Description |
|---|---|---|
name | String | parameter name |
IEnumerable(Of String))Checking for the missing required parameter, this function will returns the missing parameter in the current cli command line object using a specific parameter name list.
(检查list之中的所有参数是否存在,函数会返回不存在的参数名)
| Name | Type | Description |
|---|---|---|
list | IEnumerable(Of String) | - |
String())Gets a list of missing required argument name.
| Name | Type | Description |
|---|---|---|
args | String() | - |
String, Boolean)Does the specific argument exists in this commandline? argument name is not case sensitity.
(参数名称字符串大小写不敏感)
| Name | Type | Description |
|---|---|---|
parameterName | String | - |
String)Parsing the commandline string as object model
| Name | Type | Description |
|---|---|---|
CommandLine | String | - |
String, String)Determined that the specific Boolean flag is exists or not? if not then returns failure, if exists such flag, then returns the name.
| Name | Type | Description |
|---|---|---|
name | String | Boolean flag name |
failure | String | - |
String, String)If the target parameter is not presents in the CLI, then this function will returns nothing.
(键值对之间使用分号分隔)
| Name | Type | Description |
|---|---|---|
name | String | - |
String)Gets the value Of the specified column As a Boolean.
(这个函数也同时包含有开关参数的,开关参数默认为逻辑值类型,当包含有开关参数的时候,其逻辑值为True,反之函数会检查参数列表,参数不存在则为空值字符串,则也为False)
| Name | Type | Description |
|---|---|---|
parameter | String | 可以包含有开关参数 |
String, String)About s:
- If the file path is not a value path, then is the value is not null, the argument value will be returned from this parameter.
- If the value is nothing, then this function will open the standard input as input.
- If the file path is valid as input file, then a local file system pointer will be returned.
[管道函数] 假若参数名存在并且所指向的文件也存在,则返回本地文件的文件指针,否则返回标准输入的指针
| Name | Type | Description |
|---|---|---|
param | String | - |
s | String |
|
If the StreamWriter.BaseStream is FileStream, then it means not a std_out pointer. ([管道函数] 假若参数名存在,则返回本地文件的文件指针,否则返回标准输出的指针)
| Name | Type | Description |
|---|---|---|
param | String | - |
String)Read all of the text input from the file or std_in
这个函数会首先尝试使用CommandLine.OpenStreamInput()打开本地文件和标准输出流 如果失败的话CommandLine.OpenStreamInput()函数会返回空值,这个时候参数字符串将会直接被 返回作为结果,如果打开成功的话,会将得到的输入流之中的所有字符串读出来返回
| Name | Type | Description |
|---|---|---|
param | String | - |
String)Return the index Of the named field. If the name is not exists in the parameter list, then a -1 value will be return.
String)Gets the String value Of the specified argument.
String, Func(Of String, ``0))| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
parameter | String | Command parameter name in the command line inputs. |
__getObject | Func(Of String, ``0) | - |
String, ``0, Func(Of String, ``0))If the given parameter is not exists in the user input arguments, then a developer specific default value will be return.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
name | String | The optional argument parameter name |
[default] | ``0 | The default value for returns when the parameter is not exists in the user input. |
cast | Func(Of String, ``0) | The custom string parser for the CLI argument value |
Open a file handle by using the parameter value
| Name | Type | Description |
|---|---|---|
name | String | The parameter name, and its argument value should be a valid file path |
[default] | String | Default file path if the argument value is not exists |
这个枚举函数也会将开关给包含进来,与CommandLine.ToArgumentVector()方法所不同的是,这个函数里面的逻辑值开关的名称没有被修饰剪裁
Adds an item to the System.Collections.Generic.ICollection`1.
| Name | Type | Description |
|---|---|---|
item | NamedValue(Of String) | - |
String, String, Boolean, String)Add a parameter with name and its value.
| Name | Type | Description |
|---|---|---|
key | String | - |
value | String | - |
Clear the inner list buffer
只是通过比较名称来判断是否存在,值没有进行比较
| Name | Type | Description |
|---|---|---|
item | NamedValue(Of String) | - |
String)Removes a parameter by name
| Name | Type | Description |
|---|---|---|
paramName | String | - |
Removes a parameter by NamedValue.Name
| Name | Type | Description |
|---|---|---|
item | NamedValue(Of String) | - |
将当前的这个命令行对象之中的所有的参数值都合并到一个向量之中返回. (ToArray拓展好像是有BUG的,所以请使用这个函数来获取所有的参数信息。 请注意,逻辑值开关的名称会被去掉前缀)
the description value in the populated vector is indicates the argument value type.
String)Open a handle for a file system object.
| Name | Type | Description |
|---|---|---|
args | CommandLine | - |
fs | String | - |
String)Gets the CLI parameter value.
| Name | Type | Description |
|---|---|---|
args | CommandLine | - |
name | String | - |
String)Try get parameter value.
| Name | Type | Description |
|---|---|---|
args | CommandLine | - |
name | String | - |
Try get parameter value.
| Name | Type | Description |
|---|---|---|
args | CommandLine | - |
The command name that parse from the input command line.
(从输入的命令行中所解析出来的命令的名称)
The command tokens that were parsed from the input commandline.
(从所输入的命令行之中所解析出来的命令参数单元)
Listing all of the parameter value collection that parsed from the commandline string.
得到当前的命令行对象之中的所有的参数的名称的列表
The parameters in the commandline without the first token of the command name.
(将命令行解析为词元之后去掉命令的名称之后所剩下的所有的字符串列表)
对于参数而言,都是--或者-或者/或者\开头的,下一个单词为单引号或者非上面的字符开头的,例如/o <path> 对于开关而言,与参数相同的其实符号,但是后面不跟参数而是其他的开关,通常开关用来进行简要表述一个逻辑值
获取得到通过/@set参数所传入的环境变量(键值对之间使用分号分隔)
this readonly property ensure that the result dictionary is always not null, but may be empty.
Get the original command line string.
(获取所输入的命令行对象的原始的字符串)
String)The parameter name is not case sensitive.
(开关的名称是不区分大小写的,进行字符串插值脚本化处理的时候,是使用的App.GetVariable()函数来获取环境变量值)
| Name | Type | Description |
|---|---|---|
paramName | String | The argument name in the commandline. 2018-09-10为了兼容VB的!字典取值语法,这个属性是会自动处理开关参数的前缀的 即会自动的将开关参数的/--等前缀删除尝试进行取值 这个自动转换不会应用于逻辑开关参数上面 |
Does this cli command line object contains any parameter argument information.
(查看本命令行参数对象之中是否存在有参数信息)
String of CommandLine.Name AndAlso CommandLine.IsNullOrEmpty
Get the switch counts in this commandline object.(获取本命令行对象中的所定义的开关的数目)
原始的命令行字符串
String)String, String)String, Func(Of String, T))String, T, Func(Of String, T))Int32)String)String, CommandLine)String)String)String)String)String(), Boolean)