+static void update_progress(struct config *conf, char *op, char *path) {
+ if (!conf->verbose) {
+ return;
+ }
+
+ if (conf->progress == 0) {
+ pdots(50, '.', conf->ops_completed-1, conf->ops_completed, conf->ops_total);
+ } else if (conf->progress == 1) {
+ size_t len = strlen(path);
+ int offset = 0;
+ if (len > 50) {
+ offset = len-50;
+ }
+ printf("\r%lu/%lu %.10s %.50s\n", conf->ops_completed,
+ conf->ops_total, op, path+offset);
+ } else if (conf->progress == 2) {
+ printf("%lu/%lu %s %s\n", conf->ops_completed,
+ conf->ops_total, op, path);
+ }
+ fflush(stdout);
+}
+