# Path: invoke/util.py
# LOG_FORMAT = "%(name)s.%(module)s.%(funcName)s: %(message)s"
# def enable_logging():
# def task_name_sort_key(name):
# def cd(where):
# def has_fileno(stream):
# def isatty(stream):
# def encode_output(string, encoding):
# def helpline(obj):
#     def __init__(self, **kwargs):
#     def run(self):
#     def exception(self):
#     def is_dead(self):
#     def __repr__(self):
# class ExceptionHandlingThread(threading.Thread):
# 
# Path: invoke/exceptions.py
# class ParseError(Exception):
#     """
#     An error arising from the parsing of command-line flags/arguments.
# 
#     Ambiguous input, invalid task names, invalid flags, etc.
# 
#     .. versionadded:: 1.0
#     """
# 
#     def __init__(self, msg, context=None):
#         super(ParseError, self).__init__(msg)
#         self.context = context


import copy
    from ..vendor.lexicon import Lexicon
    from ..vendor.fluidity import StateMachine, state, transition
    from lexicon import Lexicon
    from fluidity import StateMachine, state, transition
from ..util import debug
from ..exceptions import ParseError
                # If it wasn't in either, raise the original context's
                # exception, as that's more useful / correct.
                raise e
        debug("Moving to flag {!r}".format(self.flag))
        # Bookkeeping for iterable-type flags (where the typical 'value
        # non-empty/nondefault -> clearly it got its value already' test is
        # insufficient)
        self.flag_got_value = False
        # Handle boolean flags (which can immediately be updated)
        if not self.flag.takes_value:
            val = not inverse
            debug("Marking seen flag {!r} as {}".format(self.flag, val))
            self.flag.value = val

    def see_value(self, value):
        self.check_ambiguity(value)
        if self.flag.takes_value:
            debug("Setting flag {!r} to value {!r}".format(self.flag, value))
            self.flag.value = value
            self.flag_got_value = True
        else:
            self.error("Flag {!r} doesn't take any value!".format(self.flag))

    def see_positional_arg(self, value):
        for arg in self.context.positional_args:
            if arg.value is None:
                arg.value = value
                break

    def error(self, msg):

# Path: invoke/util.py
# LOG_FORMAT = "%(name)s.%(module)s.%(funcName)s: %(message)s"
# def enable_logging():
# def task_name_sort_key(name):
# def cd(where):
# def has_fileno(stream):
# def isatty(stream):
# def encode_output(string, encoding):
# def helpline(obj):
#     def __init__(self, **kwargs):
#     def run(self):
#     def exception(self):
#     def is_dead(self):
#     def __repr__(self):
# class ExceptionHandlingThread(threading.Thread):
# 
# Path: invoke/exceptions.py
# class ParseError(Exception):
#     """
#     An error arising from the parsing of command-line flags/arguments.
# 
#     Ambiguous input, invalid task names, invalid flags, etc.
# 
#     .. versionadded:: 1.0
#     """
# 
#     def __init__(self, msg, context=None):
#         super(ParseError, self).__init__(msg)
#         self.context = context


# Path: invoke/parser/parser.py
import copy
    from ..vendor.lexicon import Lexicon
    from ..vendor.fluidity import StateMachine, state, transition
    from lexicon import Lexicon
    from fluidity import StateMachine, state, transition
from ..util import debug
from ..exceptions import ParseError

                # If it wasn't in either, raise the original context's
                # exception, as that's more useful / correct.
                raise e
        debug("Moving to flag {!r}".format(self.flag))
        # Bookkeeping for iterable-type flags (where the typical 'value
        # non-empty/nondefault -> clearly it got its value already' test is
        # insufficient)
        self.flag_got_value = False
        # Handle boolean flags (which can immediately be updated)
        if not self.flag.takes_value:
            val = not inverse
            debug("Marking seen flag {!r} as {}".format(self.flag, val))
            self.flag.value = val

    def see_value(self, value):
        self.check_ambiguity(value)
        if self.flag.takes_value:
            debug("Setting flag {!r} to value {!r}".format(self.flag, value))
            self.flag.value = value
            self.flag_got_value = True
        else:
            self.error("Flag {!r} doesn't take any value!".format(self.flag))

    def see_positional_arg(self, value):
        for arg in self.context.positional_args:
            if arg.value is None:
                arg.value = value
                break

    def error(self, msg):

        raise ParseError(msg, self.context)