NRLMMD-GEOIPS / geoips

Main Geolocated Information Processing System code base with basic functionality enabled.
https://nrlmmd-geoips.github.io/geoips/
Other
13 stars 10 forks source link

Use class factories to generate subcommands for commands like `geoips get family` and `geoips get <interface_name>` #573

Open jsolbrig opened 1 month ago

jsolbrig commented 1 month ago

Blocking issues

This is likely blocked by #576 or vice versa.

Requested Update

Description

Use class factories to generate new subcommands where appropriate within the CLI. There are several locations where this could be done. Some examples include:

Where the interface_name would become a new set of dynamically created subcommands.

Background and Motivation

Currently there are several locations where we call add_arguments with choices to handle the various interfaces. Commands like geoips list interface <interface_name> set add_argument(choices=<list_of_interface_names>). Making these into subcommands rather than an argument with choices will make the CLI function more cleanly and consistently and will help with exposing information about the available commands from the CLI. It will also simplify usage messages.

Alternative Solutions

Wait until we have made a decision about whether to change to an inheritance-based model for these classes. I'd prefer to do it now, though.

Checklist for Completion