Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd] Override --config file options from command line #2883

Merged
merged 1 commit into from
Aug 7, 2020

Conversation

csordasmarton
Copy link
Contributor

With this change options specified on the command line after the --config option
will override options specified in the config file.

@csordasmarton csordasmarton added enhancement 🌟 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands test ☑️ Adding or refactoring tests labels Aug 5, 2020
@csordasmarton csordasmarton added this to the release 6.14.0 milestone Aug 5, 2020
@csordasmarton csordasmarton requested review from gyorb and bruntib August 5, 2020 10:51
@csordasmarton csordasmarton force-pushed the override_config_file_options branch from 20ad663 to 659da25 Compare August 6, 2020 08:35
Copy link
Contributor

@bruntib bruntib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the order of command line arguments (including --config) still matters? So if some config options are written before --config flag, then the options in the given config file have priority?

@csordasmarton
Copy link
Contributor Author

@bruntib You are right.

Let's assume we have the following config file:

{
  'analyzer': ['-j10']
}

The following scenarios are possible:

# The options in the config file will be stronger. So the number of threads will be 10.
CodeChecker analyze -j4 --config myconfig.txt

# The option in the command line will override the option in the config file. So the number of threads will be 4.
CodeChecker analyze --config myconfig.txt -j4

With this change options specified on the command line after the --config option
will override options specified in the config file.
@csordasmarton csordasmarton force-pushed the override_config_file_options branch from 659da25 to bc84194 Compare August 7, 2020 07:29
@gyorb
Copy link
Contributor

gyorb commented Aug 7, 2020

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- bin/CodeChecker.py  1
         

See the complete overview on Codacy

@gyorb gyorb merged commit 485fc85 into Ericsson:master Aug 7, 2020
@csordasmarton csordasmarton deleted the override_config_file_options branch November 6, 2020 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands enhancement 🌟 test ☑️ Adding or refactoring tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants