diff options
-rw-r--r-- | src/main.sh | 4 | ||||
-rw-r--r-- | src/ui.sh | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main.sh b/src/main.sh index c62262e..4c9f849 100644 --- a/src/main.sh +++ b/src/main.sh @@ -72,6 +72,8 @@ main() exit 1 fi - init_ui "${ui}" + if ! init_ui "${ui}"; then + exit 1 + fi info 'Hello, world!' } @@ -22,6 +22,15 @@ init_ui() local ui="${1}" local fn= + case "${ui}" in + 'cli' | 'tui') + ;; + *) + printf 'Error: Invalid UI "%s"\n' "${ui}" >&2 + return 1 + ;; + esac + for fn in ${ui_functions}; do eval "${fn}() { ${ui}_${fn} \"\${@}\"; }" done |