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

627 New 'geoips tree' command #641

Open evrose54 opened 2 weeks ago

evrose54 commented 2 weeks ago

Reviewer Checklist

https://github.com/NRLMMD-GEOIPS/.github/blob/main/.github/review-template.md

Related Issues

fixes NRLMMD-GEOIPS/geoips#627

Testing Instructions

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

Summary

The GeoIPS CLI provides a variety of commands which aren't necessarily easily exposed via geoips -h. To improve this issue, we've added a geoips tree command which exposes all GeoIPS CLI commands in a tree-like fashion. This way, we can expose all commands that are available via the GeoIPS CLI, and expose the depth in which these commands exist.

By displaying the commands in a depthwise structure, users can understand what commands are available and how they are called.

If you just call geoips tree, you'll get the full command tree in a non-colored, verbose output.

The output of running geoips tree is shown below.

    geoips tree

    geoips
        geoips config
            geoips config install
        geoips get
            geoips get family
            geoips get interface
            geoips get package
            geoips get plugin
        geoips list
            geoips list interface
            geoips list interfaces
            geoips list packages
            geoips list plugins
            geoips list scripts
            geoips list test-datasets
            geoips list unit-tests
        geoips run
            geoips run single_source
            geoips run data_fusion
            geoips run config_based
        geoips test
            geoips test linting
            geoips test script
        geoips tree
        geoips validate

geoips tree additionaly provides optional arguments to filter the output of this command. Shown below are these optional arguments and descriptions of what each argument does.

    modified: docs/source/userguide/command_line.rst
    modified: geoips/commandline/ancillary_info/cmd_instructions.yaml
    modified: geoips/commandline/commandline_interface.py
    modified: geoips/commandline/geoips_command.py
    modified: tests/unit_tests/commandline/cli_top_level_tester.py
    added: geoips/commandline/geoips_tree.py
    added: tests/unit_tests/commandline/test_geoips_tree.py

Output

Screenshot 2024-06-10 at 11 14 18 AM
evrose54 commented 2 weeks ago

Note: Once the updated documentation is actually up on GitHub.io the hyperlinked outputs of the tree will point towards the appropriate location in the documentation.

biosafetylvl5 commented 1 week ago

Could we format like this?

    geoips tree
        geoips config [install]
        geoips get [family, interface, package, plugin]
        geoips list [interface, interfaces, packages, plugins, scripts, test-datasets, unit-tests]
        geoips run [single_source, data_fusion, config_based]
        geoips test [linting, script]
        geoips tree
        geoips validate

Or does that mess up the docs links?