import argparse

from settings import HONEYPORT

"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""


def parse():
    parser = argparse.ArgumentParser(
        description='Serve some sweet honey to the ubiquitous bots!',
        epilog='And that`s how you`d detect a sneaky chinese bot.',
        prog='runme.py',
        )

    parser.add_argument(
        'port',
        default=HONEYPORT,
        help='port to start a listener on (default: %(default)s, %(type)s)',
        nargs='?',
        type=int,
        )

    parser.add_argument(
        '-v',
        '--verbose',
        action='store_true',
        help='increase output verbosity',
        )

    return parser.parse_args()

import argparse

from settings import HONEYPORT

"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""


def parse():
    parser = argparse.ArgumentParser(
        description='Serve some sweet honey to the ubiquitous bots!',
        epilog='And that`s how you`d detect a sneaky chinese bot.',
        prog='mfh.py',
        )

    client_group = parser.add_mutually_exclusive_group()

    client_group.add_argument(
        '-c',
        action='store_true',
        help='launch client with on port defined in settings',
        )

    client_group.add_argument(
        '--client',
        help='port to start a client on',
        metavar='PORT',
        nargs='?',
        type=int,
        )

    parser.add_argument(
        '-v',
        '--verbose',
        action='store_true',
        help='increase output verbosity',
        )

    return parser.parse_args()

Add argument for launching client
Add argument for launching client

Before, client would launch automatically on port you specify as a
positional argument.
This means you can't just not to launch the client.
Now, there are 2 options:
    1) -c to launch client on the port defined in settings
    2) --client to specify the port explicitly
So, if you want to launch just the server without client, there
will be an option for that, just say what to launch.
