<commit_before>import os
from argparse import ArgumentParser

from dodo_commands import Dodo
from dodo_commands.framework.config import Paths


def _args():
    parser = ArgumentParser()
    parser.add_argument(
        '--message', '-m', dest='message', help='The commit message')
    args = Dodo.parse_args(parser)
    return args


if Dodo.is_main(__name__, safe=True):
    args = _args()

    if not os.path.exists(os.path.join(Paths().config_dir(), '.git')):
        Dodo.run(['git', 'init'], cwd=Paths().config_dir())

    Dodo.run(['git', 'add', '-A'], cwd=Paths().config_dir())
    Dodo.run(['git', 'commit', '-m', args.message or 'Update configuration'],
             cwd=Paths().config_dir())<commit_msg>Add arg --alt to commit-config<commit_after>import os

from dodo_commands import Dodo
from dodo_commands.framework.config import Paths


def _args():
    Dodo.parser.add_argument('--alt', help='Run an alternative git command')
    Dodo.parser.add_argument('--message',
                             '-m',
                             dest='message',
                             help='The commit message')
    args = Dodo.parse_args()
    args.cwd = Paths().config_dir()
    return args


if Dodo.is_main(__name__, safe=True):
    args = _args()

    if args.alt:
        Dodo.run(['git', *args.alt.split()], cwd=args.cwd)
    else:
        if not os.path.exists(os.path.join(args.cwd, '.git')):
            Dodo.run(['git', 'init'], cwd=args.cwd)

        Dodo.run(['git', 'add', '-A'], cwd=args.cwd)
        Dodo.run(
            ['git', 'commit', '-m', args.message or 'Update configuration'],
            cwd=args.cwd)
{'fraction_non_alphanumeric': 0.1657492354740061, 'fraction_numerical': 0.0, 'mean_word_length': 2.6681614349775784, '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': '4041758', 'n_tokens_mistral': 530, 'n_tokens_neox': 521, 'n_words': 117}