Permalink
Browse files

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

  • Loading branch information...
petya2164 committed Sep 29, 2016
1 parent bd2b2d8 commit 574434898083a891f8b27b05e89c3e1a4bca01e3
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/astyle_main.cpp
View
@@ -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();
}

0 comments on commit 5744348

Please sign in to comment.