Open Bug 1714239 Opened 3 years ago Updated 3 years ago

allow for using `formatter_class` kwarg in @CommandArgument

Categories

(Firefox Build System :: Mach Core, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: mozilla, Unassigned)

References

Details

argparse auto-wraps and auto-normalizes whitespace in help comments. This is generally helpful, but sometimes you want to specially format your help comments, and argparse allows for this via the formatter_class kwarg.

I tried using this with a @CommandArgument and that proceeded to die with TypeError: __init__() got an unexpected keyword argument 'formatter_class'.

So now, my help, which currently looks like

            "clobber": delete cloned repos.
            "prepurge": purge outgoing revisions from strings repo at beginning.
            ...

in code, gets output as

                        "clobber": delete cloned repos. "prepurge": purge
                        outgoing revisions from strings repo at beginning.

which is less readable.

I started digging into the @CommandArgument decorator to try to add formatter_class to this allowlist, but that seemed to push the error deeper into mach internals.

Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.