added a --noprogressbar switch for scripts to use

This commit is contained in:
Judd Vinet 2006-01-28 05:07:50 +00:00
parent f3c5f9b4d1
commit be38a51750
3 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@ typedef struct __config_t {
unsigned short help;
unsigned short upgrade;
unsigned short noconfirm;
unsigned short noprogressbar;
unsigned short op_d_vertest;
unsigned short op_d_resolve;
unsigned short op_q_isfile;

View File

@ -64,6 +64,10 @@ static int log_progress(netbuf *ctl, int xfered, void *arg)
static unsigned short mouth;
static unsigned int lastcur = 0;
if(config->noprogressbar) {
return(1);
}
gettimeofday(&t1, NULL);
if(xfered+offset == fsz) {
t = t0;

View File

@ -300,6 +300,7 @@ int parseargs(int argc, char *argv[])
{"config", required_argument, 0, 1001},
{"ignore", required_argument, 0, 1002},
{"debug", required_argument, 0, 1003},
{"noprogressbar", no_argument, 0, 1004},
{0, 0, 0, 0}
};
char root[PATH_MAX];
@ -319,6 +320,7 @@ int parseargs(int argc, char *argv[])
break;
case 1002: config->op_s_ignore = list_add(config->op_s_ignore, strdup(optarg)); break;
case 1003: config->debug = atoi(optarg); break;
case 1004: config->noprogressbar = 1; break;
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
case 'D':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_DEPTEST);
@ -482,6 +484,7 @@ void usage(int op, char *myname)
}
printf(" --config <path> set an alternate configuration file\n");
printf(" --noconfirm do not ask for anything confirmation\n");
printf(" --noprogressbar do not show a progress bar when downloading files\n");
printf(" -v, --verbose be verbose\n");
printf(" -r, --root <path> set an alternate installation root\n");
printf(" -b, --dbpath <path> set an alternate database location\n");