By using the tab function key in the CLI the names of commands, options, objects and object properties can be automatically completed. If the text entered before pressing tab only matches one possible item, e.g. "activate" is the only match for "acti", and a command is expected, the name will be autocompleted. Should there be more than one match the part common to all matches will be completed. At this point the user can either enter more characters or press tab again, which will display a list of the possible completions. This can also be done without entering any characters, but the resulting list might be long if there are many possible completions, e.g. all commands.
Example 1.3. Tab completion
An example of tab completion when using the add command:
Device:/>
add Add (tab)Device:/>
add Address ("ress" was autocompleted)Device:/>
add Address i (tab)Device:/>
add Address IP4 ("IP4" was autocompleted)Device:/>
add Address IP4 (tab, or double tab if IP4 were entered manually) (A list of all types starting with IP4 is listed)Device:/>
add Address IP4a (tab)Device:/>
add Address IP4Address ("Address" was autocompleted)Device:/>
add Address IP4Address example_ip a (tab)Device:/>
add Address IP4Address example_ip Address= ("Address=" was autocompleted)Device:/>
add Address IP4Address example_ip Address=1.2.3.4
Tab completion of references:
Device:/>
set Address IP4Group examplegroup Members= (tab, tab) (A list of valid objects is displayed)Device:/>
set Address IP4Group examplegroup Members=e (tab)Device:/>
set Address IP4Group examplegroup Members=example_ip ("example_ip" was autocompleted)
It is possible to get help about available properties of configuration objects while a command
line is being typed by using the ?
character. Write ?
instead of a property name and press tab and help text for the available properties is shown.
If ?
is typed instead of a property value and tab is pressed, help text
for that property which contains more information such as data type, default value, etc. is displayed.
Example 1.4. Inline help
Get inline help for all properties of an IP4Address:
Device:/>
set IP4Address example_ip ? (tab)
(Help text describing all available properties is displayed)
Getting inline help for the Address property:
Device:/>
set IP4Address example_ip Address=? (tab)
(More detailed help text about Address is displayed)
Another special character that can be used together with tab completion is the period ".
"
character.
If ".
" is entered instead of a property value and tab is pressed it will be
replaced by the current value of that property. This is useful when editing an existing list of items or a long text
value.
The "<" character before a tab can be used to automatically fill in the default value for a parameter if no value has yet been set. If the "." character is used, all possible values will be shown and these can then be edited with the back arrrow and backspace keys.
Example 1.5. Edit an Existing Property Value in the CLI
Edit the current value:
Device:/>
add IP4Address example_ip Address=1.2.3.4Device:/>
set IP4Address example_ip Address=. (tab)Device:/>
set IP4Address example_ip Address=1.2.3.4 (the value was inserted) The value can now be edited by using the arrow keys or backspace.Device:/>
set IP4Group examplegroup Members=ip1,ip2,ip3,ip5Device:/>
set IP4Group examplegroup Members=. (tab)Device:/>
set IP4Group examplegroup Members=ip1,ip2,ip3,ip5 (current value is inserted and it is now possible to add or remove a member to the list without having to enter all the other members again)
Edit the default value:
Device:/>
add LogReceiverSyslog example Address=example_ip LogSeverity=. (tab)Device:/>
add LogReceiverSyslog example Address=example_ip LogSeverity=Emergency,Alert,Critical,Error,Warning,Notice,Info
It is now easy to remove a log severity.
Some object types are grouped together in a category in the CLI. This only matters when using tab completion as they are used to limit the number of possible completions when tab completing object types. The category can always be omitted when running commands if the type name is entered manually.
Example 1.6. Using categories with tab completion
Accessing an IP4Address object with the use of categories:
Device:/>
show ad (tab)Device:/>
show Address (the category is autocompleted)Device:/>
show Address ip4a (tab)Device:/>
show Address IP4Address (the type is autocompleted)Device:/>
show Address IP4Address example_ip
Accessing an IP4Address object without the use of categories:
Device:/>
show IP4Address example_ip