프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$charIndex | integer | If the current cursor position is at the end of the current command, the value of this variable is equal to the length of $this->commandLine Bash equivalent: COMP_POINT | |
$commandLine | string | Bash equivalent: COMP_LINE | |
$wordBreaks | string | Bash equivalent: COMP_WORDBREAKS | |
$wordIndex | integer | null | This is not set until $this->splitCommand() is called. Bash equivalent: COMP_CWORD | |
$words | array | null | This is not set until $this->splitCommand() is called, when it is populated by $commandLine exploded by $wordBreaks Bash equivalent: COMP_WORDS |
메소드 | 설명 | |
---|---|---|
getCharIndex ( ) : integer | Get the character index of the user's cursor on the command line | |
getCommandLine ( ) : string | Return the current command line verbatim as a string | |
getCurrentWord ( ) : string | Return the word from the command line that the cursor is currently in | |
getWordAtIndex ( integer $index ) : string | Return a word by index from the command line | |
getWordIndex ( ) : integer | Get the index of the word the cursor is currently in | |
getWords ( ) : array | Get the contents of the command line, exploded into words based on the configured word break characters | |
setCharIndex ( integer $index ) | Set the cursor position as a character index relative to the start of the command line | |
setCommandLine ( string $commandLine ) | Set the whole contents of the command line as a string | |
setWordBreaks ( string $charList ) | Set characters to use as split points when breaking the command line into words |
메소드 | 설명 | |
---|---|---|
reset ( ) | Reset the computed words so that $this->splitWords is forced to run again | |
splitCommand ( ) : string[] | Split the command line into words using the configured word break characters |
public getCharIndex ( ) : integer | ||
리턴 | integer |
public getCommandLine ( ) : string | ||
리턴 | string |
public getCurrentWord ( ) : string | ||
리턴 | string |
public getWordAtIndex ( integer $index ) : string | ||
$index | integer | |
리턴 | string |
public getWordIndex ( ) : integer | ||
리턴 | integer |
protected reset ( ) |
public setCharIndex ( integer $index ) | ||
$index | integer |
public setCommandLine ( string $commandLine ) | ||
$commandLine | string |
public setWordBreaks ( string $charList ) | ||
$charList | string | - a single string containing all of the characters to break words on |
protected splitCommand ( ) : string[] | ||
리턴 | string[] |
protected int $charIndex | ||
리턴 | integer |