summaryrefslogtreecommitdiff
path: root/lib/command_match.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-10-02 04:47:31 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-10-02 04:47:31 +0000
commita78596c42d43a01de85c7ada95d15b165743f6ff (patch)
treeef4c84ce04a8219f2416d974a6cd5dd55be8ce36 /lib/command_match.h
parent51d41d759bcd02506ec562018faace777dcee352 (diff)
lib: explicitly support the case of empty input for completions
When the user tab- or ?-completes when the character prior to the position of the cursor is a space, completion logic is passed null. Explicitly handle this case instead of using partly_match, which has special logic associated with it to allow abbreviating certain tokens. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command_match.h')
-rw-r--r--lib/command_match.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/command_match.h b/lib/command_match.h
index 728d9c1d95..ac4e70c316 100644
--- a/lib/command_match.h
+++ b/lib/command_match.h
@@ -50,9 +50,10 @@ enum matcher_rv
/* completion match types */
enum match_type
{
- no_match,
- partly_match,
- exact_match
+ trivial_match, // the input is null
+ no_match, // the input does not match
+ partly_match, // the input matches but is incomplete
+ exact_match // the input matches and is complete
};
/* Defines which matcher_rv values constitute an error. Should be used with