From 5c503403e61fc8e50653e0871f870534eafc221a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 22 Feb 2011 07:55:51 +0000 Subject: [PATCH] add command completion to "print" git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1888 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 4 ++++ urjtag/src/cmd/cmd_print.c | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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, };