diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-03-20 15:53:53 +0200 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-04-02 15:04:33 +0300 |
commit | 8a005252d1b9351395a31ff463007ba9a3295774 (patch) | |
tree | 3b0d611cd83e7b845729916150c37a47cba9dc5f | |
parent | 4ac06ff97e8fdf9c30c2987df63680274e3356fe (diff) | |
download | weston-8a005252d1b9351395a31ff463007ba9a3295774.tar.gz weston-8a005252d1b9351395a31ff463007ba9a3295774.tar.bz2 weston-8a005252d1b9351395a31ff463007ba9a3295774.zip |
ivi-shell: add cmdline option for controller module
This will be useful for tests, where we use --no-config, but ivi-shell
needs load the controller module from somewhere.
We are not making hmi-controller.so the default, because this patch
should allow running the tests also with another controller.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
-rw-r--r-- | ivi-shell/ivi-shell.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 362a3c3a..aef8e638 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -386,20 +386,26 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell, static int ivi_shell_setting_create(struct ivi_shell_setting *dest, - struct weston_compositor *compositor) + struct weston_compositor *compositor, + int *argc, char *argv[]) { int result = 0; struct weston_config *config = compositor->config; struct weston_config_section *section; - if (NULL == dest) - return -1; + const struct weston_option ivi_shell_options[] = { + { WESTON_OPTION_STRING, "ivi-module", 0, &dest->ivi_module }, + }; + + parse_options(ivi_shell_options, ARRAY_LENGTH(ivi_shell_options), + argc, argv); section = weston_config_get_section(config, "ivi-shell", NULL, NULL); - if (weston_config_section_get_string(section, "ivi-module", - &dest->ivi_module, NULL) != 0) { - weston_log("ivi-shell: No ivi-module set in config\n"); + if (!dest->ivi_module && + weston_config_section_get_string(section, "ivi-module", + &dest->ivi_module, NULL) < 0) { + weston_log("Error: ivi-shell: No ivi-module set\n"); result = -1; } @@ -424,7 +430,7 @@ module_init(struct weston_compositor *compositor, if (shell == NULL) return -1; - if (ivi_shell_setting_create(&setting, compositor) != 0) + if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0) return -1; init_ivi_shell(compositor, shell, &setting); |