Skip to content

Commit 8596299

Browse files
Optimized silent handling
1 parent 4a3d928 commit 8596299

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

Main.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ uint64_t handleDirectory(const Options& opts, const std::string& path, const std
143143
fileSize = data.nFileSizeLow | (data.nFileSizeHigh << (sizeof(DWORD) * 8));
144144
}
145145
size += fileSize;
146-
auto fz = getFileSize(opts, fileSize);
147146

148147
if (!opts.silent)
148+
{
149+
auto fz = getFileSize(opts, fileSize);
149150
Log::fileSize(fz.value) << fz.suffix << " " << relativeFileName << "\n";
151+
}
150152
}
151153
while (FindNextFileA(find, &data));
152154

@@ -162,12 +164,13 @@ int main(int argc, const char* argv[])
162164
if (opts.workPaths.empty())
163165
{
164166
if (!opts.silent)
165-
Log::error() << "No work paths were specified.\n";
167+
{
168+
Log::error() << "No work paths were specified.\n";
169+
}
166170
return 1;
167171
}
168-
else
172+
else if (!opts.silent)
169173
{
170-
if (!opts.silent)
171174
Log::info() << "Working with " << opts.workPaths.size() << " work paths\n";
172175
}
173176

@@ -183,7 +186,10 @@ int main(int argc, const char* argv[])
183186
}
184187

185188
if (!opts.silent)
186-
Log::info() << "Summary: \n";
189+
{
190+
Log::info() << "Summary: \n";
191+
}
192+
187193
for (const auto& entry : summary)
188194
{
189195
Log::fileSize(entry.second.value)

0 commit comments

Comments
 (0)