What order of reading configuration values?

后端 未结 2 778
刺人心
刺人心 2021-02-07 11:11

For the python program I am writing I would like to give the opportunity of configuring it in three different ways. Environment variables, configuration files and command line a

2条回答
  •  清歌不尽
    2021-02-07 11:13

    AWS CLI is in line with the accepted answer:

    Precedence of options:

    • If you specify an option by using one of the environment variables described in this topic, it overrides any value loaded from a profile in the configuration file.

    • If you specify an option by using a parameter on the CLI command line, it overrides any value from either the corresponding environment variable or a profile in the configuration file.

提交回复
热议问题