the 2nd arg to get/set/test is a literal "signal"

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1892 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 14 years ago
parent 642c7e42e0
commit 80d68a944c

@ -9,6 +9,10 @@
* src/global/parse.c (urj_parse_line): Include the line when debugging.
* src/cmd/cmd_get.c, src/cmd/cmd_set.c, src/cmd/cmd_test.c: Fix up help text
from an earlier commit -- make sure the literal "signal" is the 2nd arg in
the help text and for completion handlers.
2011-02-21 Mike Frysinger <vapier@gentoo.org>
* data/Makefile.am (nobase_dist_pkgdata_DATA): Add missing analog/bfin/bfin.

@ -96,10 +96,16 @@ static void
cmd_get_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;
switch (token_point)
{
case 1:
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "signal");
break;
cmd_signal_complete (chain, matches, match_cnt, text, text_len);
case 2:
cmd_signal_complete (chain, matches, match_cnt, text, text_len);
break;
}
}
const urj_cmd_t urj_cmd_get = {

@ -107,7 +107,7 @@ static void
cmd_set_help (void)
{
urj_log (URJ_LOG_LEVEL_NORMAL,
_("Usage: %s SIGNAL DIR [DATA]\n"
_("Usage: %s signal SIGNAL DIR [DATA]\n"
"Set signal state in input BSR (Boundary Scan Register).\n"
"\n"
"SIGNAL signal name (from JTAG declaration file)\n"
@ -123,16 +123,20 @@ cmd_set_complete (urj_chain_t *chain, char ***matches, size_t *match_cnt,
{
switch (token_point)
{
case 1: /* name */
case 1:
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "signal");
break;
case 2: /* name */
cmd_signal_complete (chain, matches, match_cnt, text, text_len);
break;
case 2: /* direction */
case 3: /* direction */
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "in");
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "out");
break;
case 3: /* value */
case 4: /* value */
/* XXX: Only applies if token[1] == "out" ... */
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "0");
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "1");

@ -101,7 +101,7 @@ static void
cmd_test_help (void)
{
urj_log (URJ_LOG_LEVEL_NORMAL,
_("Usage: %s SIGNAL 0/1\n"
_("Usage: %s signal SIGNAL 0/1\n"
"Test signal state from output BSR (Boundary Scan Register).\n"
"\n"
"SIGNAL signal name (from JTAG declaration file)\n"),
@ -114,10 +114,15 @@ cmd_test_complete (urj_chain_t *chain, char ***matches, size_t *match_cnt,
{
switch (token_point)
{
case 1: /* name */
case 1:
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "signal");
break;
case 2: /* name */
cmd_signal_complete (chain, matches, match_cnt, text, text_len);
break;
case 2: /* value */
case 3: /* value */
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "0");
urj_completion_mayben_add_match (matches, match_cnt, text, text_len, "1");
break;

Loading…
Cancel
Save