This branch refactors commands which use the form of geoips get <interface_name> to
make use of class factories. Before, we had to run commands such as:
geoips get interface <interface_name>
geoips get family <interface_name> <family_name>
geoips get plugin <interface_name> <family_name>
The aforementioned commands were overly verbose and needed some refactoring to reduce
the levels required to execute a certain command. In this branch, we refactored
GeoipsGetInterface to be a base command for get <interface_name>,
get <interface_name> family <family_name>, and
get <interface_name> <plugin_name>. This resulted in the removal of
GeoipsGetFamily and GeoipsGetPlugin and the refactoring of
GeoipsGetInterface to include the functionality of those other commands. We can use
class factories for each interface to execute these commands now.
On top of this, we implemented aliases for a variety of CLI commands. For an exact
listing of aliases available for each command, see
geoips/commandline/ancillary_info/alias_mapping.yaml, which includes aliases
supported for each command. Now, we can run a verbose command such as:
geoips list algorithms -p geoips
and replace it with
geoips ls algs -p geoips
This also reduces the verbosity of certain CLI commands. Note, the unit tests have been
modified to reflect these changes.
Reviewer Checklist
Related Issues
fixes NRLMMD-GEOIPS/geoips#573 fixes NRLMMD-GEOIPS/geoips#576
Testing Instructions
Run
pytest -v ./tests/unit_tests/commandline/
Summary
This branch refactors commands which use the form of
geoips get <interface_name>
to make use of class factories. Before, we had to run commands such as:geoips get interface <interface_name>
geoips get family <interface_name> <family_name>
geoips get plugin <interface_name> <family_name>
The aforementioned commands were overly verbose and needed some refactoring to reduce the levels required to execute a certain command. In this branch, we refactored
GeoipsGetInterface
to be a base command forget <interface_name>
,get <interface_name> family <family_name>
, andget <interface_name> <plugin_name>
. This resulted in the removal ofGeoipsGetFamily
andGeoipsGetPlugin
and the refactoring ofGeoipsGetInterface
to include the functionality of those other commands. We can use class factories for each interface to execute these commands now.On top of this, we implemented aliases for a variety of CLI commands. For an exact listing of aliases available for each command, see
geoips/commandline/ancillary_info/alias_mapping.yaml
, which includes aliases supported for each command. Now, we can run a verbose command such as:geoips list algorithms -p geoips
and replace it with
geoips ls algs -p geoips
This also reduces the verbosity of certain CLI commands. Note, the unit tests have been modified to reflect these changes.