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

CLI class factory #642

Open evrose54 opened 2 weeks ago

evrose54 commented 2 weeks ago

Reviewer Checklist

Related Issues

partially addresses NRLMMD-GEOIPS/geoips#573 partially addresses NRLMMD-GEOIPS/geoips#576

Testing Instructions

Run pytest -v ./tests/unit_tests/commandline/

Summary

While this PR doesn't fix all of the problems addressed in the issues above, it is our initial attempt at creating a class factory for certain CLI commands to reduce the verbage needed to execute those commands. Spefically in this branch, we've addressed the command class GeoipsListSingleInterface. We now use the aforementioned class as a base class to build GeoipsListSingleInterface<interface_name> classes at runtime.

By doing so, we can now run geoips list <interface_name> rather than geoips list interface <interface_name>. This improves the readability of this command and makes it much easier to type via the CLI. We expect in future PRs to address similar commands, such as geoips get family <family_name> and geoips get plugin <interface_name> <plugin_name> for the reasons mentioned previously.

modified: docs/source/userguide/command_line.rst
modified: geoips/commandline/ancillary_info/cmd_instructions.yaml
modified: geoips/commandline/geoips_command.py
modified: geoips/commandline/geoips_list.py
modified: tests/unit_tests/commandline/cli_top_level_tester.py
modified: tests/unit_tests/commandline/test_geoips_list_interface.py