static int flag_gcov_file = 1;
+/* Output progress indication if this is true. This is off by default
+ and can be turned on by the -d option. */
+
+static int flag_display_progress = 0;
+
/* For included files, make the gcov output file name include the name
of the input source file. For example, if x.h is included in a.c,
then the output file name is a.c##x.h.gcov instead of x.h.gcov. */
main (int argc, char **argv)
{
int argno;
+ int first_arg;
/* Unlock the stdio streams. */
unlock_std_streams ();
if (argc - argno > 1)
multiple_files = 1;
+ first_arg = argno;
+
for (; argno != argc; argno++)
- process_file (argv[argno]);
+ {
+ if (flag_display_progress)
+ printf("Processing file %d out of %d\n",
+ argno - first_arg + 1, argc - first_arg);
+ process_file (argv[argno]);
+ }
generate_results (multiple_files ? NULL : argv[argc - 1]);
fnotice (file, " -o, --object-directory DIR|FILE Search for object files in DIR or called FILE\n");
fnotice (file, " -p, --preserve-paths Preserve all pathname components\n");
fnotice (file, " -u, --unconditional-branches Show unconditional branch counts too\n");
+ fnotice (file, " -d, --display-progress Display progress information\n");
fnotice (file, "\nFor bug reporting instructions, please see:\n%s.\n",
bug_report_url);
exit (status);
{ "object-directory", required_argument, NULL, 'o' },
{ "object-file", required_argument, NULL, 'o' },
{ "unconditional-branches", no_argument, NULL, 'u' },
+ { "display-progress", no_argument, NULL, 'd' },
{ 0, 0, 0, 0 }
};
{
int opt;
- while ((opt = getopt_long (argc, argv, "abcfhlno:puv", options, NULL)) != -1)
+ while ((opt = getopt_long (argc, argv, "abcdfhlno:puv", options, NULL)) != -1)
{
switch (opt)
{
case 'u':
flag_unconditional = 1;
break;
+ case 'd':
+ flag_display_progress = 1;
+ break;
case 'v':
print_version ();
/* print_version will exit. */