cli: Add new `config' CLI for status/config registers
TBD
For instance, the quad-enable bit can then be queried like this:
$ flashprog config -p ch341a_spi --get quad-enable
TODO: Write a manpage once the syntax is agreed upon.
Change-Id: I6b9d26c67e6ad65be5df367d2db7942bb98f27ac
Signed-off-by: Nico Huber <nico.h@gmx.de>
diff --git a/cli.c b/cli.c
index 82723fd..6a0cbe1 100644
--- a/cli.c
+++ b/cli.c
@@ -27,6 +27,8 @@
} commands[] = {
{ "mem", flashprog_classic_main },
{ "memory", flashprog_classic_main },
+ { "cfg", flashprog_config_main },
+ { "config", flashprog_config_main },
};
static void usage(const char *const name)
@@ -35,6 +37,7 @@
fprintf(stderr, "\nWhere <command> can be\n\n"
" mem[ory] Standard memory operations\n"
" (read/erase/write/verify)\n"
+ " cfg|config Status/config register operations\n"
"\n"
"The default is 'memory'. See `%s <command> --help`\n"
"for further instructions.\n\n", name);