Closed JPeterson462 closed 4 years ago
I have to think about this a little more, but my concern is that this is adding functionality to Registrable
which is specific to the commands subclasses, whereas this should be generic for any of the subclasses (like Metric).
I added an optional parameter to Registrable.register() and made Subcommand a subclass of Registrable. Example usage:
@Subcommand.register('this-command', 'parent-command')
Subcommand._registry and Subcommand._parents could be used to generate the argparse parser.