"""
The definition of the IApplicationOptions interface.
"""
#
# Copyright Qualcomm Technologies Inc, 2019.
# All Rights Reserved
#
from zope.interface import Interface, Attribute
# Zope interface bends the rules slightly, so ignore these pylint warnings:
# pylint: disable=no-self-argument,inherit-non-class,no-method-argument
[docs]class IApplicationOptions(Interface):
"""The command line arguments to the Package Manager application.
Rather than re-define all the command line options as interface
attributes, the ``options`` attribute of this class is simply the
``argparse.Namespace`` instance.
This interface will be registered as a utility. This means that
anwyhere in application code, the command line options to the app
can be retreived using this pattern::
from zope.component import getUtility
from pminterfaces.options import IApplicationOptions
...
# e.g. get the verbosity command line argument:
verbosity = getUtility(IApplicationOptions).options.verbosity
"""
options = Attribute("The ``argparse.Namespace`` object that "
"is used to parse the command line arguments.")