# Path: harpoon/errors.py
# class BadOption(HarpoonError):
#     desc = "Bad Option"


from harpoon.errors import BadOption
from delfick_project.option_merge import MergedOptions
from delfick_project.norms import dictobj
                from harpoon.actions import available_actions
        from harpoon.collector import Collector
            for key, val in self.overrides.items():
                overrides[key] = val
                if isinstance(val, MergedOptions):
                    overrides[key] = dict(val.items())
            configuration.update(overrides)

        if task_func.needs_image:
            self.find_image(image, configuration)
            image = configuration["images"][image]
            image.find_missing_env()


        new_collector = Collector()
        new_collector.configuration = configuration
        new_collector.configuration_file = collector.configuration_file
        artifact = configuration["harpoon"].artifact
        return task_func(new_collector, image=image, tasks=tasks, artifact=artifact, **extras)

    def find_image(self, image, configuration):
        """Complain if we don't have an image"""
        images = configuration["images"]
        available = list(images.keys())

        if not image:
            info = {}
            if available:
                info["available"] = available
            raise BadOption("Please use --image to specify an image", **info)

        if image not in images:

# Path: harpoon/errors.py
# class BadOption(HarpoonError):
#     desc = "Bad Option"


# Path: harpoon/option_spec/task_objs.py
from harpoon.errors import BadOption
from delfick_project.option_merge import MergedOptions
from delfick_project.norms import dictobj
                from harpoon.actions import available_actions
        from harpoon.collector import Collector

            for key, val in self.overrides.items():
                overrides[key] = val
                if isinstance(val, MergedOptions):
                    overrides[key] = dict(val.items())
            configuration.update(overrides)

        if task_func.needs_image:
            self.find_image(image, configuration)
            image = configuration["images"][image]
            image.find_missing_env()


        new_collector = Collector()
        new_collector.configuration = configuration
        new_collector.configuration_file = collector.configuration_file
        artifact = configuration["harpoon"].artifact
        return task_func(new_collector, image=image, tasks=tasks, artifact=artifact, **extras)

    def find_image(self, image, configuration):
        """Complain if we don't have an image"""
        images = configuration["images"]
        available = list(images.keys())

        if not image:
            info = {}
            if available:
                info["available"] = available
            raise BadOption("Please use --image to specify an image", **info)

        if image not in images:

            raise BadOption("No such image", wanted=image, available=available)