Editing Command Lines
Editing Feature
You can edit commands in a CLI that supports multi-line edition. Each command can contain a maximum of 510 characters. The keywords in the commands are case insensitive. Whether a command parameter is case sensitive or not depends on what the parameter is.
Table 1-1 lists keys that are frequently used for command editing.
Key |
Function |
---|---|
Common key |
Inserts a character at the current location of the cursor if the editing buffer is not full, and the cursor moves to the right. Otherwise, an alarm is generated. |
Backspace |
Deletes the character on the left of the cursor and the cursor moves to the left. When the cursor reaches the head of the command, an alarm is generated. |
Left cursor key ← or Ctrl+B |
Moves the cursor to the left by the space of a character. When the cursor reaches the head of the command, an alarm is generated. |
Right cursor key → or Ctrl+F |
Moves the cursor to the right by the space of a character. When the cursor reaches the end of the command, an alarm is generated. |
Operating Techniques
Incomplete Keyword
You can enter incomplete keywords on the device. In the current view, you do not need to enter complete keywords if the entered characters can match a unique keyword. This function improves operating efficiency.
For example, to execute the display current-configuration command, you can enter d cu, di cu, or dis cu. However, you cannot enter d c or dis c because they do not match unique keywords.
The maximum length of a command (including the incomplete command) to be entered is 510 characters. If a command in incomplete form is configured, the system saves it to the configuration file in its complete form, which may exceed the 510-character limit. In this case, the command in incomplete form cannot be restored after the system restarts. Therefore, when you configure a command in incomplete form, pay attention to the length of the command.
Tab
- When a unique keyword matches the input, the system replaces the incomplete input with the unique keyword and displays it in a new line followed by a space. For example:
Enter an incomplete keyword.
[HUAWEI] info-
Press Tab.
The system replaces the entered keyword and displays it in a new line with the complete keyword followed by a space.[HUAWEI] info-center
- When the input has multiple matches, press Tab repeatedly to display the keywords beginning with the incomplete input in a circle until the desired keyword is displayed. In this case, the cursor closely follows the end of the keyword. For example:
Enter an incomplete keyword.
[HUAWEI] info-center log
Press Tab.
The system displays the prefixes of all the matched keywords. In this example, the prefix is log.[HUAWEI] info-center loghost
Press Tab to switch from one matched keyword to another. In this case, the cursor closely follows the end of a word.[HUAWEI] info-center logbuffer
Stop pressing Tab when the desired keyword is displayed.
- When an incorrect keyword is entered, press Tab and it is displayed in a new line without being changed. For example:
Enter an incorrect keyword.
[HUAWEI] info-center loglog
Press Tab.
[HUAWEI] info-center loglog
The system displays information in a new line, but the keyword loglog remains unchanged and there is no space between the cursor and the keyword. This indicates that this keyword does not exist.