diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 592703a7..299d7d53 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -2,6 +2,8 @@ * src/cmd/cmd_print.c: Add a completion handler. + * src/cmd/cmd_debug.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_debug.c b/urjtag/src/cmd/cmd_debug.c index 8a37e6e2..bffb655a 100644 --- a/urjtag/src/cmd/cmd_debug.c +++ b/urjtag/src/cmd/cmd_debug.c @@ -131,9 +131,27 @@ cmd_debug_help (void) "debug"); } +static void +cmd_debug_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, "all"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "comm"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "debug"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "detail"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "normal"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "warning"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "error"); + urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "silent"); +} + const urj_cmd_t urj_cmd_debug = { "debug", N_("set logging/debugging level"), cmd_debug_help, - cmd_debug_run + cmd_debug_run, + cmd_debug_complete, };