Add argparse arguments from all options of one :class:`Optionable`

    >>> # Let's build a dummy optionable component:
    >>> comp = Optionable()
    >>> comp.add_option("num", Numeric(default=1, max=12, help="An exemple of option"))
    >>> comp.add_option("title", Text(help="The title of the title"))
    >>> comp.add_option("ok", Boolean(help="is it ok ?", default=True))
    >>> comp.add_option("cool", Boolean(help="is it cool ?", default=False))
    >>>
    >>> # one can then register all the options of this component to a arg parser
    >>> parser = argparse.ArgumentParser(prog="PROG")
    >>> arguments_from_optionable(parser, comp)
    >>> parser.print_help()
    usage: PROG [-h] [--num NUM] [--title TITLE] [--not-ok] [--cool]
    <BLANKLINE>
    optional arguments:
      -h, --help     show this help message and exit
      --num NUM      An exemple of option
      --title TITLE  The title of the title
      --not-ok       is it ok ?
      --cool         is it cool ?
    
    The option values for a componant can then be retrieved with :func:`get_config_for`

    .. doctest::
        :hide:

        >>> import argparse
        >>> args = argparse.Namespace()
        >>> args.num = 1
        >>> args.title = "My title"
        >>> args.ok = True
        >>> args.cool = False

    >>> args = parser.parse_args() # doctest: +SKIP
    >>> config = get_config_for(args, comp)
    >>> comp("input", **config) # doctest: +SKIP
    "comp_result"

def arguments_from_optionable(parser, component, prefix=""):
    """ Add argparse arguments from all options of one :class:`Optionable`

    >>> # Let's build a dummy optionable component:
    >>> comp = Optionable()
    >>> comp.add_option("num", Numeric(default=1, max=12, help="An exemple of option"))
    >>> comp.add_option("title", Text(help="The title of the title"))
    >>> comp.add_option("ok", Boolean(help="is it ok ?", default=True))
    >>> comp.add_option("cool", Boolean(help="is it cool ?", default=False))
    >>>
    >>> # one can then register all the options of this component to a arg parser
    >>> parser = argparse.ArgumentParser(prog="PROG")
    >>> arguments_from_optionable(parser, comp)
    >>> parser.print_help()
    usage: PROG [-h] [--num NUM] [--title TITLE] [--not-ok] [--cool]
    <BLANKLINE>
    optional arguments:
      -h, --help     show this help message and exit
      --num NUM      An exemple of option
      --title TITLE  The title of the title
      --not-ok       is it ok ?
      --cool         is it cool ?
    
    The option values for a componant can then be retrieved with :func:`get_config_for`

    .. doctest::
        :hide:

        >>> import argparse
        >>> args = argparse.Namespace()
        >>> args.num = 1
        >>> args.title = "My title"
        >>> args.ok = True
        >>> args.cool = False

    >>> args = parser.parse_args() # doctest: +SKIP
    >>> config = get_config_for(args, comp)
    >>> comp("input", **config) # doctest: +SKIP
    "comp_result"
    """
    for option in component.options:
        if component.options[option].hidden:
            continue
        argument_from_option(parser, component, option, prefix=prefix)