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
Change-Id: I32818b58c9db939719913fc63063c41a27876554
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72991
diff --git a/cli_config.c b/cli_config.c
index 3ffa048..7fbd310 100644
--- a/cli_config.c
+++ b/cli_config.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include <getopt.h>
#include <limits.h>
@@ -88,7 +89,7 @@
"\t%s [get] <options> <setting>\n"
"\t%s set <options> [--temporary] <setting> <value>\n",
name, name);
- print_generic_options();
+ print_generic_options(/* layout_options =>*/false);
fprintf(stderr, "\n<setting> can be\n"
" qe | quad-enable Quad-Enable (QE) bit\n"
"\nand <value> can be `true', `false', or a number.\n"