# shellcheck shell=dash disable=2034

# Please remove the profile
___x_cmd_cfgy_obj_rm(){
    local X_help_cmd="${X_help_cmd:-x help -m cfgy obj --rm}"
    local config=
    local profile=
    local X_arg_help=
    local N=cfgy
    while [ "$#" -gt 0 ]; do
        cfgy:arg:config-profile:parse
    done

    [ -z "$X_arg_help" ] || {
        ___x_cmd help --show
        return 0
    }

    [ -n "$profile" ] || {
        cfgy:error "Provide profile name"
        return 64
    }

    [ -n "$config" ] || {
        # In the interactive mode, ask whether using default config filepath.
        if ___x_cmd_runmode_allow_chatty && ___x_cmd ui yesno "Whether using default config filepath ?"; then
            config="$___X_CMD_CFGY_OBJ_DEFAULT_CONFIG"
        else
            cfgy:error "Provide config name"
            return 64
        fi
    }
    ___x_cmd_cfgy_inner_rm "$___X_CMD_CFGY_OBJ_PREFIX" "$profile" "$config"
}
