parseKeyin Method

Given a string consisting of a toolId followed by any number of arguments, locate the corresponding Tool and parse the arguments. Tokens are delimited by whitespace. The Tool is determined by finding the longest string of unquoted tokens starting at the beginning of the key-in string that matches a registered Tool's keyin or englishKeyin. Tokens following the Tool's keyin are parsed as arguments. Arguments may be quoted using "double quotes". The opening quote must be preceded by whitespace. Examples, assuming the tool Id is my keyin:

  • my keyin "abc" "def" => two arguments: abc and def
  • my keyin abc"def" => one argument: abc"def" A literal double-quote character can be embedded in a quoted argument as follows:
  • my keyin "abc""def" => one argument: abc"def.

parseKeyin(keyin: string): ParseKeyinResult

@returns The tool, if found, along with an array of parsed arguments.

Parameter Type Description
keyin string A string consisting of a toolId followed by any number of arguments. The arguments are separated by whitespace.

Returns - ParseKeyinResult

The tool, if found, along with an array of parsed arguments.

Defined in

Last Updated: 19 April, 2024