Jaymon / captain

command line python scripts for humans
MIT License
13 stars 1 forks source link

Add a group param to the @arg decorator #72

Closed Jaymon closed 1 year ago

Jaymon commented 1 year ago

It would be nice to be able to do something like this:

@arg("--foo", group="bar")
@arg("--che", group="bar")
@arg("--baz")
def handle(self, bar, baz):
    self.output.out(f"bar: {bar.foo}, che: {bar.che}")

the key names in the group object should match up to any dest value

Jaymon commented 1 year ago

https://docs.python.org/3/library/argparse.html#argument-groups