# Path: docpie/error.py
# class DocpieError(Exception, DocpieException):
#     """Error in construction of usage-message by developer."""
# 
# class UnknownOptionExit(DocpieExit):
#     """Unknown options found in argv"""
# 
#     def __init__(self, message, option=None, inside=None):
#         super(UnknownOptionExit, self).__init__(message)
#         self.option = option
#         self.inside = inside
# 
# class AmbiguousPrefixExit(DocpieExit):
#     """Long option has an ambiguous prefix"""
#     def __init__(self, message, prefix=None, ambiguous=None):
#         super(AmbiguousPrefixExit, self).__init__(message)
#         self.prefix = prefix
#         self.ambiguous = ambiguous


import logging
from docpie.error import DocpieError, UnknownOptionExit, AmbiguousPrefixExit
                if this_opt not in names:
                    self.error = UnknownOptionExit(
                        'Unknown option: %s.' % this_opt,
                        option=this_opt,
                        inside=each,
                    )
                    result.extend(self[index:])
                    break

                result.append(each)

                expect_args = names[this_opt]
                if this_opt != each:
                    expect_args = 0

            elif not each.startswith('--'):
                result.append(each)
                continue
            else:
                option, equal, value = each.partition('=')
                if option in names:
                    result.append(each)
                    if equal:
                        expect_args = 0
                    else:
                        expect_args = names[option]
                else:
                    possible = list(
                        filter(lambda x: x.startswith(option), names))
                    if not possible:

# Path: docpie/error.py
# class DocpieError(Exception, DocpieException):
#     """Error in construction of usage-message by developer."""
# 
# class UnknownOptionExit(DocpieExit):
#     """Unknown options found in argv"""
# 
#     def __init__(self, message, option=None, inside=None):
#         super(UnknownOptionExit, self).__init__(message)
#         self.option = option
#         self.inside = inside
# 
# class AmbiguousPrefixExit(DocpieExit):
#     """Long option has an ambiguous prefix"""
#     def __init__(self, message, prefix=None, ambiguous=None):
#         super(AmbiguousPrefixExit, self).__init__(message)
#         self.prefix = prefix
#         self.ambiguous = ambiguous


# Path: docpie/tokens.py
import logging
from docpie.error import DocpieError, UnknownOptionExit, AmbiguousPrefixExit

                if this_opt not in names:
                    self.error = UnknownOptionExit(
                        'Unknown option: %s.' % this_opt,
                        option=this_opt,
                        inside=each,
                    )
                    result.extend(self[index:])
                    break

                result.append(each)

                expect_args = names[this_opt]
                if this_opt != each:
                    expect_args = 0

            elif not each.startswith('--'):
                result.append(each)
                continue
            else:
                option, equal, value = each.partition('=')
                if option in names:
                    result.append(each)
                    if equal:
                        expect_args = 0
                    else:
                        expect_args = names[option]
                else:
                    possible = list(
                        filter(lambda x: x.startswith(option), names))
                    if not possible:

                        self.error = UnknownOptionExit(