def port(port):
        """
        Port validator

        :param port: Port to validate (1 - 65535)
        :return: Port passed in (if valid)
        :raises ArgumentTypeError if port is not valid
        """
        value = int(port)
        if value <= 0 or value > 65535:
            raise argparse.ArgumentTypeError("%s must be between [1 - 65535]" % port)
        return value
Port validator

        :param port: Port to validate (1 - 65535)
        :return: Port passed in (if valid)
        :raises ArgumentTypeError if port is not valid