How to use the green.config.parseArguments function in green

To help you get started, we’ve selected a few green examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CleanCut / green / green / command.py View on Github external
def get_user_options():

    # When running "python setup.py --help-commands", setup.py will call this
    # function -- but green isn't actually being called.
    if "--help-commands" in sys.argv:
        return []

    r = parseArguments()
    options = []

    for action in r.store_opt.actions:
        names = [str(name.lstrip('-')) for name in action.option_strings]
        if len(names) == 1: names.insert(0, None)
        if not action.const: names[1] += str("=")
        options.append((names[1], names[0], action.help))

    return options