Author: Frank Heckenbach Reviewed-by: Rogério Theodoro de Brito Bug-Debian: http://bugs.debian.org/589112 Forwarded: no Subject: New option "--force-progress-bar" Last-Update: 2010-11-06 --- a/main.c +++ b/main.c @@ -213,6 +213,8 @@ " -q --quiet : quiet operation\n" " -e --stderr-progress : force output of progress information to\n" " stderr (for wrapper scripts)\n" +" -E --force-progress-bar : force output of progress bar even if\n" +" stderr is not a terminal\n" " -l --log-summary [] : save result summary to file, default\n" " filename cdparanoia.log\n" " -L --log-debug [] : save detailed device autosense and\n" @@ -341,6 +343,7 @@ long callbegin; long callend; long callscript=0; +long force_progress_bar=0; static char *callback_strings[16]={"wrote", "finished", @@ -407,13 +410,13 @@ } } - if(!quiet){ + if(force_progress_bar || !quiet){ long test; osector=inpos; sector=inpos/CD_FRAMEWORDS; if(printit==-1){ - if(isatty(STDERR_FILENO)){ + if(force_progress_bar || isatty(STDERR_FILENO)){ printit=1; }else{ printit=0; @@ -607,10 +610,11 @@ memset(dispcache,' ',graph); } -const char *optstring = "escCn:o:O:d:g:k:S:prRwafvqVQhZz::YXWBi:Tt:l::L::A"; +const char *optstring = "eEscCn:o:O:d:g:k:S:prRwafvqVQhZz::YXWBi:Tt:l::L::A"; struct option options [] = { {"stderr-progress",no_argument,NULL,'e'}, + {"force-progress-bar",no_argument,NULL,'E'}, {"search-for-drive",no_argument,NULL,'s'}, {"force-cdrom-little-endian",no_argument,NULL,'c'}, {"force-cdrom-big-endian",no_argument,NULL,'C'}, @@ -786,6 +790,9 @@ callscript=1; fprintf(stderr,"Sending all callbacks to stderr for wrapper script\n"); break; + case 'E': + force_progress_bar=1; + break; case 'V': fprintf(stderr,VERSION); fprintf(stderr,"\n");