Skip to content

Commit 545ccaf

Browse files
committed
refactor: add placeholder hint display for port list candidates when no prefix is provided
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
1 parent 1187f6a commit 545ccaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/cli/cli_auto_complete.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,13 @@ _portlist_collect_candidates(const char *prefix, char ***out_list, int *out_cnt)
394394
if (_str_list_add_unique(out_list, out_cnt, "all"))
395395
return -1;
396396

397+
/* Also show the placeholder hint alongside real values when no prefix is typed. */
398+
if (!prefix || !*prefix) {
399+
const char *hint = _placeholder_hint("%P");
400+
if (hint && _str_list_add_unique(out_list, out_cnt, hint))
401+
return -1;
402+
}
403+
397404
return *out_cnt;
398405
}
399406

0 commit comments

Comments
 (0)