Skip to content

Commit 51fcf14

Browse files
committed
lstopo: show a message about the export filename and format
Only shown if exporting to a file, that file is not stdout, stdout is a terminal, and the output format is not window. Signed-off-by: Brice Goglin <[email protected]> (cherry picked from commit 096c89d)
1 parent 5f9ddc8 commit 51fcf14

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utils/lstopo/lstopo.c

+9
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,15 @@ main (int argc, char *argv[])
17951795
filename);
17961796
}
17971797

1798+
#ifdef HAVE_ISATTY
1799+
/* if exporting to a file (which is not stdout, rewritten as "-" above),
1800+
* and stdout is a terminal,
1801+
* show a message about the export filename and format.
1802+
*/
1803+
if (filename && strcmp(filename, "-") && output_format != LSTOPO_OUTPUT_WINDOW && isatty(STDOUT_FILENO))
1804+
printf("Exporting format `%s' to file `%s'\n", output_format_name(output_format), filename);
1805+
#endif
1806+
17981807
if (output_format != LSTOPO_OUTPUT_XML) {
17991808
/* there might be some xml-imported userdata in objects, add lstopo-specific userdata in front of them */
18001809
lstopo_populate_userdata(hwloc_get_root_obj(topology));

0 commit comments

Comments
 (0)