summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-10-17 13:05:58 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2017-10-17 13:05:58 +0200
commit9a8a52cb077a086b3881c8e182b8259443519041 (patch)
treee80fa7d5fa6b1aa1786bfc39c0815a2124aa1f7e
parent69223234666afdf739483b64a41e3419f5a00f69 (diff)
downloadrockbox-9a8a52c.tar.gz
rockbox-9a8a52c.tar.bz2
rockbox-9a8a52c.zip
nwztools/scsitool: slightly rework of help_us and help
Now print list of devices immediately even if the rest of the command line is empty (ie 'scsitool -s ?' works, whereas before one would need an actual device to even get a list). Add more information in the help_us command: print kas, lyr and fpi. Change-Id: Icfeeaeebe28c774a74ca54661357fafa25c3d114
-rw-r--r--utils/nwztools/scsitools/scsitool.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c
index 5a359177dd..ee8c0b16e4 100644
--- a/utils/nwztools/scsitools/scsitool.c
+++ b/utils/nwztools/scsitools/scsitool.c
@@ -336,11 +336,7 @@ int get_model_and_series(int *model_index, int *series_index)
/* display list on error */
if(*series_index == -1)
{
- if(strcmp(g_force_series, "?") != 0)
- cprintf(GREY, "Unrecognized series '%s'\n", g_force_series);
- cprintf(OFF, "Series list:\n");
- for(int i = 0; i < NWZ_SERIES_COUNT; i++)
- printf(" %-10s %s\n", nwz_series[i].codename, nwz_series[i].name);
+ cprintf(GREY, "Unrecognized series '%s', use -s ? to get a list of supported devices\n", g_force_series);
return -1;
}
}
@@ -987,6 +983,9 @@ void help_us(bool unsupported, unsigned long model_id)
cprintf(BLUE, "-------------------[ Paste information below ]-------------------\n");
cprintf_field("Model ID: ", "%#lx\n", model_id);
get_dev_info(0, NULL);
+ get_dhp(0, NULL);
+ static char *list[] = { "kas", "lyr", "fpi" };
+ get_dnk_nvp_multi(sizeof(list) / sizeof(list[0]), list);
}
int main(int argc, char **argv)
@@ -1029,6 +1028,15 @@ int main(int argc, char **argv)
}
}
+ /* list devices */
+ if(g_force_series && strcmp(g_force_series, "?") == 0)
+ {
+ cprintf(OFF, "Series list:\n");
+ for(int i = 0; i < NWZ_SERIES_COUNT; i++)
+ printf(" %-10s %s\n", nwz_series[i].codename, nwz_series[i].name);
+ return 0;
+ }
+
if(argc - optind < 2)
{
usage();