dotnet / dotnet/command-line-api
Question: Best way to use different configs per command line arguement
Open
question
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
I kind of feel like this has to be dumb question, but I'm looking for a decent way to use different configurations based on a command line flag. I have a CLI tool that I interact with different versions of a database (development, staging, production) and want to change the behavior based on an argument passed rather than an environment variable. I'm currently using dependency injection with System.CommandLine.Hosting. Any suggestions?
Contributor guide
Assessment
This issue has not been assessed yet.