Only change the return code if --print-changes is used with --dry-run

This commit is contained in:
Peter Vingelmann 2016-09-29 19:49:06 +02:00
parent bd2b2d8dd2
commit 5744348980

View File

@ -3847,10 +3847,11 @@ int main(int argc, char** argv)
g_console->processFiles();
int return_code = EXIT_SUCCESS;
if (g_console->getPrintChanges() && g_console->getFilesFormatted() > 0)
if (g_console->getIsDryRun() && g_console->getPrintChanges()
&& g_console->getFilesFormatted() > 0)
{
// Use the number of formatted files as a return code with the
// --print-changes option
// --print-changes + --dry-run option
return_code = g_console->getFilesFormatted();
}