def parse_args(argv):
    parser = fbuild.options.make_parser()

    # -------------------------------------------------------------------------
    # Let the fbuildroot modify the optparse parser before parsing.

    try:
        pre_options = fbuildroot.pre_options
    except AttributeError:
        pass
    else:
        parser = pre_options(parser) or parser

    options, args = parser.parse_args(argv[1:])

    # -------------------------------------------------------------------------
    # Let the fbuildroot modify the optparse parser after parsing.

    try:
        post_options = fbuildroot.post_options
    except __HOLE__:
        pass
    else:
        options, args = post_options(options, args) or (options, args)

    return fbuild.context.Context(options, args)

# ------------------------------------------------------------------------------
dataset/ETHPy150Open felix-lang/fbuild/lib/fbuild/main.py/parse_args