<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import signal
import sys
import tomahawk_bootstrap

parent, bin_dir = tomahawk_bootstrap.set_lib_path(__file__)

import argparse
from tomahawk.command_line import RsyncContext
from tomahawk.constants import DEFAULT_EXPECT_TIMEOUT
from tomahawk.log import create_logger
from tomahawk.main import RsyncMain
from tomahawk.utils import shutdown_by_signal

# Trap SIGINT(Ctrl-C) to quit executing a command
signal.signal(signal.SIGINT, shutdown_by_signal)

def create_argument_parser():
    p = argparse.ArgumentParser(
        prog = os.path.basename(__file__),
        description = 'A simple rsync executor for many hosts.',
        conflict_handler = 'resolve'
    )

    p.add_argument(
        'source', metavar='source', help='source',
    )
    p.add_argument(
        'destination', metavar='destination', help='destination',
    )
    p.add_argument(
        '-h', '--hosts', metavar='HOST',
        help='host names for rsync.',
    )
    p.add_argument(
        '-f', '--hosts-files', metavar='HOST_FILE',
        help='hosts files listed host names.'
    )
    p.add_argument(
        '--rsync-user', help='rsync user.'
    )
    p.add_argument(
        '-o', '--rsync-options', help='rsync options. (default: "-avz")'
    )
    p.add_argument(
        '-m', '--mirror-mode',
        help='"push" or "pull". "pull" means copy files remote -> local (default: "push")'
    )
    p.add_argument(
        '-a', '--append-host-suffix', action='store_true', default=True,
        help='Append host name to destination file/dir (only when "--mirror-mode=pull").'
    )
    p.add_argument(
        '-c', '--continue-on-error', action='store_true', default=None,
        help='Command exectuion continues whatever any errors.'
    )
    p.add_argument(
        '-p', '--parallel', metavar='NUM', type=int, default=1,
        help='A number for parallel command execution. (default: 1)'
    )
    p.add_argument(
        '-l', '--prompt-login-password', action='store_true',
        help='Prompt a password for ssh authentication.'
    )
    p.add_argument(
        '--expect-timeout', metavar='SECONDS', type=int, default=DEFAULT_EXPECT_TIMEOUT,
        help='Specify expect timeout in seconds. (default: %d)' % (DEFAULT_EXPECT_TIMEOUT)<commit_msg>Added -u for --rsync-user<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import signal
import sys
import tomahawk_bootstrap

parent, bin_dir = tomahawk_bootstrap.set_lib_path(__file__)

import argparse
from tomahawk.command_line import RsyncContext
from tomahawk.constants import DEFAULT_EXPECT_TIMEOUT
from tomahawk.log import create_logger
from tomahawk.main import RsyncMain
from tomahawk.utils import shutdown_by_signal

# Trap SIGINT(Ctrl-C) to quit executing a command
signal.signal(signal.SIGINT, shutdown_by_signal)

def create_argument_parser():
    p = argparse.ArgumentParser(
        prog = os.path.basename(__file__),
        description = 'A simple rsync executor for many hosts.',
        conflict_handler = 'resolve'
    )

    p.add_argument(
        'source', metavar='source', help='source',
    )
    p.add_argument(
        'destination', metavar='destination', help='destination',
    )
    p.add_argument(
        '-h', '--hosts', metavar='HOST',
        help='host names for rsync.',
    )
    p.add_argument(
        '-f', '--hosts-files', metavar='HOST_FILE',
        help='hosts files listed host names.'
    )
    p.add_argument(
        '-u', '--rsync-user', help='rsync user.'
    )
    p.add_argument(
        '-o', '--rsync-options', help='rsync options. (default: "-avz")'
    )
    p.add_argument(
        '-m', '--mirror-mode',
        help='"push" or "pull". "pull" means copy files remote -> local (default: "push")'
    )
    p.add_argument(
        '-a', '--append-host-suffix', action='store_true', default=True,
        help='Append host name to destination file/dir (only when "--mirror-mode=pull").'
    )
    p.add_argument(
        '-c', '--continue-on-error', action='store_true', default=None,
        help='Command exectuion continues whatever any errors.'
    )
    p.add_argument(
        '-p', '--parallel', metavar='NUM', type=int, default=1,
        help='A number for parallel command execution. (default: 1)'
    )
    p.add_argument(
        '-l', '--prompt-login-password', action='store_true',
        help='Prompt a password for ssh authentication.'
    )
    p.add_argument(
        '--expect-timeout', metavar='SECONDS', type=int, default=DEFAULT_EXPECT_TIMEOUT,
        help='Specify expect timeout in seconds. (default: %d)' % (DEFAULT_EXPECT_TIMEOUT)
{'fraction_non_alphanumeric': 0.14175257731958762, 'fraction_numerical': 0.001288659793814433, 'mean_word_length': 3.0215889464594126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7280650', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1488, 'n_words': 351}