cli: Add a new CLI wrapper
This new CLI wrapper introduces a command mode, like we are used from
Git for instance. The first argument specifies the command mode, which
is `memory` for the classic flashprog CLI. Alternatively to a first
argument, it can be called as `flashprog-cmd`. This will allow us to
add more CLI features that can be developed independently from the
classic CLI.
For instance, flashprog could then be called like this:
$ flashprog memory -p ch341a_spi
$ flashprog mem -p ch341a_spi
If no command mode is specified, we fall back to the classic CLI for
convenience. So this is also still possible:
$ flashprog -p ch341a_spi
Change-Id: I98cb110b47ebce52daf2e0972fc4565ef9d40242
Signed-off-by: Nico Huber <nico.h@gmx.de>
diff --git a/Makefile b/Makefile
index 79601fc..a75c280 100644
--- a/Makefile
+++ b/Makefile
@@ -401,7 +401,7 @@
###############################################################################
# Frontend related stuff.
-CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
+CLI_OBJS = cli.o cli_classic.o cli_output.o cli_common.o print.o
# By default version information will be fetched from Git if available.
# Otherwise, versioninfo.inc stores the metadata required to build a