diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 4216380a..592703a7 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,7 @@ +2011-02-22 Mike Frysinger + + * src/cmd/cmd_print.c: Add a completion handler. + 2011-02-21 Mike Frysinger * data/Makefile.am (nobase_dist_pkgdata_DATA): Add missing analog/bfin/bfin. diff --git a/urjtag/src/cmd/cmd_print.c b/urjtag/src/cmd/cmd_print.c index 71cb9d42..9dff05b0 100644 --- a/urjtag/src/cmd/cmd_print.c +++ b/urjtag/src/cmd/cmd_print.c @@ -280,9 +280,23 @@ cmd_print_help (void) "print"); } +static void +cmd_print_complete (urj_chain_t *chain, char ***matches, size_t *match_cnt, + const char *text, size_t text_len, size_t token_point) +{ + if (token_point != 1) + return; + + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "chain"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "bus"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "signals"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "instructions"); +} + const urj_cmd_t urj_cmd_print = { "print", N_("display JTAG chain list/status"), cmd_print_help, - cmd_print_run + cmd_print_run, + cmd_print_complete, };