mittwald / cli

The mittwald command-line interface
https://developer.mittwald.de/cli
MIT License
7 stars 0 forks source link

Use context to filter list command #56

Open LukasFritzeDev opened 1 year ago

LukasFritzeDev commented 1 year ago

I’ve currently set the org-id context

~ ❯ mw context get                                              

Current CLI context

--project-id   not set
--server-id    not set
--org-id       65543619-a808-4787-bf1d-×××××××

When calling mw project list all project are listed, wich includes projects from other organisations.

It would be great to have to option to filter the output by the current context org-id or server-id.

martin-helmich commented 1 year ago

I actually thought about this before, but was unsure if this behaviour wasn't too much "magic", i.e. unexpected for the user, when you forget that you've set an org id somewhere in your context and then wonder why you're only getting a filtered subset of your data... 🤔

Further discussion is warranted. Should we decide to build this, this behaviour should also be consistent across all "list" commands.

LukasFritzeDev commented 1 year ago

I can see your point. If not as default behaviour, an option would be to provide an opt-in flag like --filter-context.