<commit_before>#!/bin/bash

if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
    echo -e "Search /etc for .pacnew files and invoke vimdiff on them."
    echo -e "After each file ask for removal.\n"
    echo -e "Options:"
    echo -e "\t-h, --help:\tShow help."
    echo -e "\t-l, --list:\tOnly list .pacnew files without invoking vimdiff."
elif [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]]; then
    find /etc -name *.pacnew
else
    dowork () {
        vimdiff "$(echo $1 | sed s/.pacnew$//)" "$1"

        read -p "Remove $1 ? " -n 1 -r
        echo
        [[ $REPLY =~ ^[YyJj]$ ]] && sudo rm "$1"
    }
    export -f dowork
    find /etc -name *.pacnew -execdir bash -c 'dowork {}' \;
fi<commit_msg>Show "[y/n]" when prompting for file removal<commit_after>#!/bin/bash

if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
    echo -e "Search /etc for .pacnew files and invoke vimdiff on them."
    echo -e "After each file ask for removal.\n"
    echo -e "Options:"
    echo -e "\t-h, --help:\tShow help."
    echo -e "\t-l, --list:\tOnly list .pacnew files without invoking vimdiff."
elif [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]]; then
    find /etc -name *.pacnew
else
    dowork () {
        vimdiff "$(echo $1 | sed s/.pacnew$//)" "$1"

        read -p "Remove $1 ? [y/n] " -n 1 -r
        echo
        [[ $REPLY =~ ^[YyJj]$ ]] && sudo rm "$1"
    }
    export -f dowork
    find /etc -name *.pacnew -execdir bash -c 'dowork {}' \;
fi
{'fraction_non_alphanumeric': 0.22573984858912594, 'fraction_numerical': 0.012388162422573986, 'mean_word_length': 2.029166666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7339350', 'n_tokens_mistral': 580, 'n_tokens_neox': 549, 'n_words': 182}