ldlinux: Move cmdline processing out of cli.c
authorMatt Fleming <matt.fleming@linux.intel.com>
Wed, 6 Apr 2011 13:37:43 +0000 (14:37 +0100)
committerMatt Fleming <matt.fleming@linux.intel.com>
Sat, 16 Apr 2011 13:46:37 +0000 (14:46 +0100)
commit9d9b677dd1b3bf235c0ee2dd64d476fd9d85db3a
tree909a6bfa00f9de61a8ead7e12086b4c376e46573
parent8f9153df73881f698c83716283acf5c2bb85029d
ldlinux: Move cmdline processing out of cli.c

While it makes perfect sense for cli.c to read input from the user and
parse certain characters (Ctrl-R, TABs, etc), once that processing is
done it should be up to the caller to decide what to do with the
expanded cmdline string. For example, the logic to figure out what
type of kernel we're loading (calculated from a kernel's filename
extension as typed on the command-line) is currently in cli.c, and
that is just wrong. That kind of logic belongs in ldlinux.c

So move process_command() from cli.c to ldlinux.c and extend it so
that if the user types a label name at the prompt, we load the kernel
for that label as described in the config file.

Now that we've moved all cli history code into edit_cmdline() it seems
like a good time to turn it on permanently.

Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
com32/elflink/ldlinux/cli.c
com32/elflink/ldlinux/ldlinux.c
com32/elflink/ldlinux/readconfig.c
com32/elflink/modules/cli.h
com32/elflink/modules/menu.h