Add initial functionality to support -q

dev
senhuang42 2020-08-25 13:50:44 -04:00
parent aab11ce3db
commit 7a7cd8861a
1 changed files with 15 additions and 6 deletions

View File

@ -1672,14 +1672,23 @@ int FIO_compressMultipleFilenames(FIO_prefs_t* const prefs,
assert(outFileName != NULL || suffix != NULL);
if (outFileName != NULL) { /* output into a single destination (stdout typically) */
if (nbFiles > 1 && !prefs->overwrite) {
if (!strcmp (outFileName, stdoutmark)) {
DISPLAY("zstd: WARNING: all input files will be processed and concatenated into stdout. ");
/* g_display_prefs.displayLevel <= 1 corresponds to -q flag */
DISPLAY("%d\n", g_display_prefs.displayLevel);
if (g_display_prefs.displayLevel <= 1) {
if (prefs->removeSrcFile) {
DISPLAY("zstd: Aborting... not deleting files and processing into dst: %s", outFileName);
return 1;
}
} else {
DISPLAY("zstd: WARNING: all input files will be processed and concatenated into a single output file: %s ", outFileName);
if (!strcmp (outFileName, stdoutmark)) {
DISPLAY("zstd: WARNING: all input files will be processed and concatenated into stdout. ");
} else {
DISPLAY("zstd: WARNING: all input files will be processed and concatenated into a single output file: %s ", outFileName);
}
if (prefs->removeSrcFile)
error = g_display_prefs.displayLevel > 1 && UTIL_requireUserConfirmationToProceed("Proceed? (y/n): ", "Aborting...", "yY");
DISPLAY("\n");
}
if (prefs->removeSrcFile)
error = UTIL_requireUserConfirmationToProceed("Proceed? (y/n): ", "Aborting...", "yY");
DISPLAY("\n");
}
ress.dstFile = FIO_openDstFile(prefs, NULL, outFileName);
if (ress.dstFile == NULL) { /* could not open outFileName */