Skip to content
Snippets Groups Projects
Commit 870cb2bf authored by Guy Zana's avatar Guy Zana
Browse files

cli: add a tab_pretty() function to a cli command interface

allows commands to specify a delimiter between tab completion
suggestions, the default is '\t' in case this function is not present
in the command interface.
parent ee2193be
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,11 @@ function write_suggestions(arr, command)
write_string(suggestion);
if (i != arr.length-1) {
write_char('\t');
var ch = '\t';
if ((command != undefined) && (command.tab_delim)) {
ch = command.tab_delim();
}
write_char(ch);
}
}
write_char('\n');
......
......@@ -97,7 +97,11 @@ tab_pretty(arg)
used by commands to prettify their autocompletion output,
used by the cd command
tab_delim() allows commands to specify a delimiter between tab completion
suggestions, the default is '\t' in case this function is not present
in the command interface.
help() should print a helpful description for the command, called when
the user execute "help cmd"
a
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment