# shellcheck shell=dash

___x_cmd_slash_enable(){
    case "$1" in
        -h|--help) ___x_cmd help -m slash enable; return ;;
    esac

    [ "$#" -gt 0 ] || {
        ___x_cmd help -m slash enable
        return 1
    }

    local cfgfp="$___X_CMD_SLASH_CONFIG"
    [ -f "$cfgfp" ] || {
        slash:error "Config file not found. Run 'x slash compile' first."
        return 1
    }

    local name status_changed=0
    for name in "$@"; do
        ___x_cmd_slash___set_status "$name" "enable" && status_changed=1
    done

    [ "$status_changed" -eq 1 ] && ___x_cmd_slash_compile_generate
}
