<commit_before>#!/usr/bin/env python2
# -*- coding: UTF-8 -*-

from __future__ import print_function
from __future__ import unicode_literals

import argparse


DEFAULT_CONFIG_FILE = '~/.config/xmrc'


def _new_argument_parser():
    parser = argparse.ArgumentParser(
        description='Build the appropriate make command'
    )

    parser.add_argument(
        '-u', '--unittest', help='run unittest',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-s', '--sync', help='sync local copy on the server',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-f', '--file', help='specify the configuration file',
        default=DEFAULT_CONFIG_FILE,
    )
    parser.add_argument(
        '--setup', help='run commands that should be run before sync',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-d', '--dep', help='install missing dependencies on the server',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        'project', metavar='project', type=str, nargs='+',
        help='The selected project',
    )

    return parser


def main():
    parsed_args = _new_argument_parser().parse_args()
    print(parsed_args)


if __name__ == '__main__':
    main()<commit_msg>Add a --target argument and make trailling arguments context dependant<commit_after>#!/usr/bin/env python2
# -*- coding: UTF-8 -*-

from __future__ import print_function
from __future__ import unicode_literals

import argparse


DEFAULT_CONFIG_FILE = '~/.config/xmrc'


def _new_argument_parser():
    parser = argparse.ArgumentParser(
        description='Build the appropriate make command'
    )

    parser.add_argument(
        '-u', '--unittest', help='run unittest',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-s', '--sync', help='sync local copy on the server',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-f', '--file', help='specify the configuration file',
        default=DEFAULT_CONFIG_FILE,
    )
    parser.add_argument(
        '--setup', help='run commands that should be run before sync',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-d', '--dep', help='install missing dependencies on the server',
        action='store_const', const=True, default=False,
    )
    parser.add_argument(
        '-t', '--target', help='the target on which to run'
    )
    parser.add_argument(
        'extra', metavar='extra', type=str, nargs='*',
        help='Extra variables, usage vary depending on the context',
    )

    return parser


def main():
    parsed_args = _new_argument_parser().parse_args()
    print(parsed_args)


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.13278008298755187, 'fraction_numerical': 0.0013831258644536654, 'mean_word_length': 3.080394922425952, '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': '5160669', 'n_tokens_mistral': 876, 'n_tokens_neox': 861, 'n_words': 216}