vmware-tanzu / tanzu-cli

The Tanzu Core CLI project provides the core functionality of the Tanzu CLI. The CLI is based on a plugin architecture where CLI command functionality can be delivered through independently developed plugin binaries
Apache License 2.0
33 stars 21 forks source link

Entry-specific active context type check in command mapping #783

Closed vuil closed 2 months ago

vuil commented 2 months ago

Introduce CommandMapProcessor to facilitate processing a plugin's command map. Uses an instance of said processor that is aware of the active contexts so that each command map entry can be evaluated against them for applicability.

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Updated unit tests.

Manual: Created sample plugin containing CommandMapEntry with explicity RequireContextType, verify that the mapping only takes effect when a context of matching type is active.

Release note

Support entry-specific active context type check in command mapping

Additional information

Special notes for your reviewer