cli: Add new `config' CLI for status/config registers

Add a new CLI mode to query and update status and configuration
registers of SPI NOR chips.  Programmer initialization and chip
initialization works the same as with the classic CLI (`-p' and
`-c' options). There are two commands `get' and `set' where the
former is implied if no command is given. For a start, only the
`quad-enable' bit can be accessed  (for chips that advertise it
in the database).

The `--temporary' option  allows to use a volatile write status
register command if the flash chip supports it. So changes made
with this option will not be written to flash and are lost when
the chip is reset.

For instance, the quad-enable bit can then be queried like this

  $ flashprog config get -p ch341a_spi quad-enable

or written with

  $ flashprog config set -p ch341a_spi quad-enable 1

or

  $ flashprog config set -p ch341a_spi --temporary quad-enable 1

Change-Id: I6b9d26c67e6ad65be5df367d2db7942bb98f27ac
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/195
diff --git a/meson.build b/meson.build
index f308ec6..7a3d35c 100644
--- a/meson.build
+++ b/meson.build
@@ -593,19 +593,22 @@
 config_manfile = configuration_data()
 config_manfile.set('VERSION', version)
 config_manfile.set('MAN_DATE', run_command('util/getversion.sh', '--man-date', check : true).stdout().strip())
-configure_file(
-  input : 'flashprog.8.tmpl',
-  output : 'flashprog.8',
-  configuration : config_manfile,
-  install: true,
-  install_dir: join_paths(get_option('mandir'), 'man8'),
-)
+foreach man : [ 'flashprog.8', 'flashprog-config.8' ]
+  configure_file(
+    input : man + '.tmpl',
+    output : man,
+    configuration : config_manfile,
+    install: true,
+    install_dir: join_paths(get_option('mandir'), 'man8'),
+  )
+endforeach
 
 if get_option('classic_cli').auto() or get_option('classic_cli').enabled()
   executable(
     'flashprog',
     files(
       'cli.c',
+      'cli_config.c',
       'cli_classic.c',
       'cli_common.c',
       'cli_output.c',