cli: Add new write-protect CLI
Add a new write-protect CLI that is based on the classic-CLI feature
in flashrom/master. The syntax is slighty different: With the new
CLI wrapper, we can either call it as `flashprog write-protect` or
`flashprog wp`. To keep the CLI code clean, we allow only one write-
protection operation per call.
For instance, the write-protection status can then be queried like
this:
$ flashprog wp --status -p ch341a_spi
TODO: Write a manpage once the syntax is agreed upon.
Change-Id: I32818b58c9db939719913fc63063c41a27876554
Signed-off-by: Nico Huber <nico.h@gmx.de>
diff --git a/cli.c b/cli.c
index 6a0cbe1..a4ae75d 100644
--- a/cli.c
+++ b/cli.c
@@ -29,6 +29,8 @@
{ "memory", flashprog_classic_main },
{ "cfg", flashprog_config_main },
{ "config", flashprog_config_main },
+ { "wp", flashprog_wp_main },
+ { "write-protect", flashprog_wp_main },
};
static void usage(const char *const name)
@@ -38,6 +40,7 @@
" mem[ory] Standard memory operations\n"
" (read/erase/write/verify)\n"
" cfg|config Status/config register operations\n"
+ " wp|write-protect Write-protection operations\n"
"\n"
"The default is 'memory'. See `%s <command> --help`\n"
"for further instructions.\n\n", name);