dispatch icon indicating copy to clipboard operation
dispatch copied to clipboard

Add a --context flag to dispatch

Open neosab opened this issue 7 years ago • 2 comments

Feature Request

Add a --context flag to dispatch CLI.

Detailed Description

You can have multiple contexts in the dispatch config file (~/.dispatch/config.json). Each context stores the location of a dispatch endpoint. Currently, to switch context you need to do dispatch manage context --set <context_name>. This is helpful as long as you intend to work in that context for some time.

But it's not possible to temporarily switch to a context and run a single command e.g. I just need to see if the functions are getting invoked in my production dispatch but I don't want to switch context and accidentally delete the resources in it. Hence, it will be nice to add a --context global flag to the CLI and switch the context only for that CLI command.

e.g. dispatch get functions (retrieves functions from my default dispatch context) dispatch --context prod-dispatch get functions (retrieves functions from my prod dispatch context) dispatch delete function process-credit-payment (Phew! that was just my dev-cluster)

Context

Possible Implementation

Complexity

  • [x] Low - Simple enhancement or bug fix, no architectural changes or refactoring
  • [ ] Medium - Change requires some thought, but is relatively isolated
  • [ ] High - Significant architectural change or large refactor

neosab avatar Aug 21 '18 01:08 neosab

Zhiming can you take this?

neosab avatar Aug 21 '18 01:08 neosab

Ok I will try this.

pzmrzy avatar Aug 21 '18 17:08 pzmrzy