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

import sys
import time

from watchdog.observers import Observer

from specchio.handlers import SpecchioEventHandler
from specchio.utils import init_logger, logger


def main():
    """Main function for specchio

    Example: specchio test/ user@host:test/

    :return: None
    """
    if len(sys.argv) == 3:
        src_path = sys.argv[1].strip()
        dst_ssh, dst_path = sys.argv[2].strip().split(":")
        event_handler = SpecchioEventHandler(
            src_path=src_path, dst_ssh=dst_path, dst_path=dst_path
        )
        init_logger()
        logger.info("Initialize Specchio")
        observer = Observer()
        observer.schedule(event_handler, src_path, recursive=True)
        observer.start()
        try:
            while True:
                time.sleep(1)
        except KeyboardInterrupt:
            observer.stop()
        observer.join()
    else:
        print """Specchio is a tool that can help you rsync your file,
it use `.gitignore` in git to discern which file is ignored.

Usage: specchio src/ user@host:dst"""<commit_msg>Fix the output when there is wrong usage<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import time

from watchdog.observers import Observer

from specchio.handlers import SpecchioEventHandler
from specchio.utils import init_logger, logger


def main():
    """Main function for specchio

    Example: specchio test/ user@host:test/

    :return: None
    """
    if len(sys.argv) == 3:
        src_path = sys.argv[1].strip()
        dst_ssh, dst_path = sys.argv[2].strip().split(":")
        event_handler = SpecchioEventHandler(
            src_path=src_path, dst_ssh=dst_path, dst_path=dst_path
        )
        init_logger()
        logger.info("Initialize Specchio")
        observer = Observer()
        observer.schedule(event_handler, src_path, recursive=True)
        observer.start()
        try:
            while True:
                time.sleep(1)
        except KeyboardInterrupt:
            observer.stop()
        observer.join()
    else:
        print """Usage: specchio src/ user@host:dst/"""
{'fraction_non_alphanumeric': 0.10823311748381129, 'fraction_numerical': 0.004625346901017576, 'mean_word_length': 2.5113636363636362, 'pattern_counts': {'":': 2, '<': 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': '3575767', 'n_tokens_mistral': 647, 'n_tokens_neox': 631, 'n_words': 166}