

___x_cmd_locale_ls(){
    [ "$#" -gt 0 ] ||   set -- --kv

    local op="$1"; shift
    case "$op" in
        -m|--charmaps)          ___x_cmd_locale_charmaps  "$@" ;;
        -a|--all-locales)       ___x_cmd_locale_la          "$@" ;;

        -c|--category-name|-k|--keyword-name|-ck|-kc)
                                ___x_cmd_locale_ls_ "$op" "$@" ;;
        --kv)                   ___x_cmd_locale_ls_       "$@" ;;
        -h|--help)  ;;
        *)                      N=x M="Unknown op ==> $op" log:ret:64
    esac
}

___x_cmd_locale_ls_all(){
    if ! command locale -kc LC_ALL 2>/dev/null; then
        command locale -kc  \
            LC_COLLATE      \
            LC_CTYPE        \
            LC_MESSAGES     \
            LC_MONETARY     \
            LC_NUMERIC      \
            LC_SPECIAL      \
            LC_TIME
    fi
}

___x_cmd_locale_ls_(){
    if [ $# -eq 0 ]; then
        ___x_cmd_locale_ls_all
    else
        command locale "$@"
    fi | ___x_cmd_locale_app_visualize
}

