cmd_endian: automate the completion matches

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1931 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 13 years ago
parent cfa19fc564
commit 94a2e63fcc

@ -25,6 +25,9 @@
src/cmd/cmd_shift.c, src/cmd/cmd_test.c: Add new tokens arg to completion
handlers.
* src/cmd/cmd_endian.c (cmd_endian_complete): Add matches based on existing
local array of strings.
2011-06-27 Jie Zhang <jie.zhang@analog.com>
* include/urjtag/Makefile.am (nodist_pkginclude_HEADERS): New and

@ -126,11 +126,14 @@ cmd_endian_complete (urj_chain_t *chain, char ***matches, size_t *match_cnt,
char * const *tokens, const char *text, size_t text_len,
size_t token_point)
{
size_t i;
if (token_point != 1)
return;
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "big");
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "little");
for (i = 0; i < ARRAY_SIZE(endians); ++i)
urj_completion_mayben_add_match (matches, match_cnt, text, text_len,
endians[i].name);
}
const urj_cmd_t urj_cmd_endian = {

Loading…
Cancel
Save