summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-cli.h
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-03-24 22:27:20 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-03-24 22:27:20 -0700
commit1a1b0cb1c68ecd0e0f709b1c5a94d49069bf18e6 (patch)
tree6e35fc03a8e76ec9d1aaa94019958f96ccb45e61 /com32/hdt/hdt-cli.h
parente3161f91283dcdd1486c1e22523e2fbb7259f76a (diff)
downloadsyslinux-1a1b0cb1c68ecd0e0f709b1c5a94d49069bf18e6.tar.gz
hdt: Implement aliases
Impact: New alias feature; CLi backward compatible `dmi' is now a shorthand for `set mode dmi' (idem for all modes). This is performed via a new routine: expand_aliases. It is now also possible to match aliases (e.g. `q', `quit') to a single valid command (e.g. `exit'). The list needs to be populated manually and is intented to be kept short. Eventually, the CLI will support autocompletion that will help user experience. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-cli.h')
-rw-r--r--com32/hdt/hdt-cli.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h
index aad9db8a..9101ada6 100644
--- a/com32/hdt/hdt-cli.h
+++ b/com32/hdt/hdt-cli.h
@@ -118,6 +118,14 @@ struct cli_callback_descr {
void ( * exec ) ( int argc, char** argv, struct s_hardware *hardware );
};
+/* Manage aliases */
+#define MAX_ALIASES 2
+struct cli_alias {
+ const char *command; /* Original command */
+ const int nb_aliases; /* Size of aliases array */
+ const char **aliases; /* List of aliases */
+};
+
/* List of implemented modes */
#define MAX_MODES 8
struct cli_mode_descr *list_modes[MAX_MODES];