diff --git a/lib/cli.bash b/lib/cli.bash index 111da2a6d..560d87dd4 100644 --- a/lib/cli.bash +++ b/lib/cli.bash @@ -18,7 +18,42 @@ function _omb_cmd_reload { echo 'Not yet implemented' } function _omb_cmd_theme { - echo 'Not yet implemented' + case "${1-}" in + list) + local -a available_themes + _comp_cmd_omb__get_available_themes + _omb_util_print_lines "${available_themes[@]}" + ;; + use) + local theme=${2-} + if [[ -z "$theme" ]]; then + _omb_util_print 'Usage: omb theme use ' >&2 + return 2 + fi + local -a available_themes + _comp_cmd_omb__get_available_themes + for i in "${available_themes[@]}"; do + if [ "$i" == "$theme" ]; then + _omb_module_require_theme "$theme" + return 0 + fi + done + _omb_util_print "Theme '$theme' not found" + ;; + set) + echo 'Not yet implemented' + ;; + *) + _omb_util_print_lines \ + 'Usage: omb theme ' \ + '' \ + 'Available commands:' \ + ' list List all available themes' \ + ' set Set the given theme in your .bashrc file' \ + ' use Load the given theme' + return 2 + ;; + esac } function _omb_cmd_update { echo 'Not yet implemented' @@ -161,7 +196,7 @@ function _comp_cmd_omb { theme) local -a subcmds=( 'list:List themes' - 'set:Set a theme in your .zshrc file' + 'set:Set a theme in your .bashrc file' 'use:Load a theme' ) _comp_cmd_omb__describe 'command' subcmds ;;