#!/bin/bash

# Dockertype Commands Handler
# Handles all dockertype subcommands by calling core functions

cliHandleDockertypeCommands()
{
    local docker_type="$initial_command2"
    
    if [[ -z "$docker_type" ]]; then
        cliShowDockertypeHelp
    fi
    
    case "$docker_type" in
        "rooted")
            updateConfigOption "CFG_DOCKER_INSTALL_TYPE" "rooted"
            dockerSwitcherSwap cli
            ;;
            
        "rootless")
            updateConfigOption "CFG_DOCKER_INSTALL_TYPE" "rootless"
            dockerSwitcherSwap cli
            ;;
            
        *)
            isNotice "Invalid dockertype: $docker_type"
            cliShowDockertypeHelp
            ;;
    esac
}
