<commit_before>"""
fuzza.cli
---------

Entry point to the application.
"""
import click

from . import __description__
from . import __prog__
from . import __version__
from . import data as Data
from . import dispatcher as Dispatcher
from . import transformer as Transformer
from . import protocol as Protocol
from . import templater as Templater
from .configuration import Configuration


def validate_comma_separated(ctx, param, value):
    """
    Validate multiple string input values are comma-separated. Each of
    the value is put into a list, which is returned after validation.
    """
    if value is None:
        return

    return value.split(',')


@click.group(help=__description__)
@click.version_option(version=__version__, prog_name=__prog__)
def cli():
    pass


@cli.command()
@click.option(
    '--host',
    type=str,
    metavar='<host>',
    prompt='Target hostname or IP',
    help='The hostname of target to fuzz.'
)
@click.option(
    '--port',
    type=int,
    metavar='<port>',
    prompt='Target port',
    help='The port of target to fuzz.'
)
@click.option(
    '--data-path',
    type=str,
    metavar='<path>',
    prompt='Path to fuzz data',
    help='Path containing fuzz data. Support glob patterns.'
)
@click.option(
    '--template-path',
    type=str,
    metavar='[path]',
    help='Path containing template files. Support glob patterns.'
)
@click.option(
    '--dispatcher',
    type=str,
    metavar='[dispatcher]',
    help='Type of dispatcher to use.'
)
@click.option(
    '-r',
    '--dispatcher-reuse',
    is_flag=True,
    help='Enable dispatcher connection reuse.'
)
@click.option(
    '--transformer',
    type=str,
    metavar='[transformer[, ...]]',
    callback=validate_comma_separated,
    help='List of transformations to be sequentially applied to fuzz data.'
)
@click.option(
    '--protocol',
    type=str,
    metavar='[protocol]',
    help='Type of communication protocol.'
)<commit_msg>Add default option value in CLI init subcommand<commit_after>"""
fuzza.cli
---------

Entry point to the application.
"""
import click

from . import __description__
from . import __prog__
from . import __version__
from . import data as Data
from . import dispatcher as Dispatcher
from . import transformer as Transformer
from . import protocol as Protocol
from . import templater as Templater
from .configuration import Configuration


def validate_comma_separated(ctx, param, value):
    """
    Validate multiple string input values are comma-separated. Each of
    the value is put into a list, which is returned after validation.
    """
    if value is None:
        return

    return value.split(',')


@click.group(help=__description__)
@click.version_option(version=__version__, prog_name=__prog__)
def cli():
    pass


@cli.command()
@click.option(
    '--host',
    type=str,
    metavar='<host>',
    prompt='Target hostname or IP',
    help='The hostname of target to fuzz.'
)
@click.option(
    '--port',
    type=int,
    metavar='<port>',
    prompt='Target port',
    help='The port of target to fuzz.'
)
@click.option(
    '--data-path',
    type=str,
    metavar='<path>',
    prompt='Path to fuzz data',
    help='Path containing fuzz data. Support glob patterns.'
)
@click.option(
    '--template-path',
    type=str,
    metavar='[path]',
    help='Path containing template files. Support glob patterns. []'
)
@click.option(
    '--dispatcher',
    type=str,
    metavar='[dispatcher]',
    help='Type of dispatcher to use. [tcp]'
)
@click.option(
    '-r',
    '--dispatcher-reuse',
    is_flag=True,
    help='Enable dispatcher connection reuse. [False]'
)
@click.option(
    '--transformer',
    type=str,
    metavar='[transformer[, ...]]',
    callback=validate_comma_separated,
    help='List of transformations to be sequentially applied to fuzz data. []'
)
@click.option(
    '--protocol',
    type=str,
    metavar='[protocol]',
    help='Type of communication protocol. [textual]'
)
{'fraction_non_alphanumeric': 0.13407258064516128, 'fraction_numerical': 0.0, 'mean_word_length': 3.3001083423618636, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '595497', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1233, 'n_words': 366}