Browse Source

Avoid unnecessary shell commands with --list

While the main --progress output was already hidden with the --list
action, the line was still cleared after every file.

This commit completely disables the progress bar when the --list option
is used.
pull/1/head
Daniel Scharrer 14 years ago
parent
commit
5d29acb66e
  1. 9
      src/cli/main.cpp
  2. 4
      src/util/console.cpp

9
src/cli/main.cpp

@ -258,7 +258,7 @@ static void process_file(const fs::path & file, const options & o) {
// Print filename and size
if(!o.silent) {
progress::clear();
extract_progress.clear();
std::cout << " - ";
bool named = false;
@ -285,9 +285,7 @@ static void process_file(const fs::path & file, const options & o) {
}
std::cout << '\n';
if(!o.list) {
extract_progress.update(0, true);
}
extract_progress.update(0, true);
}
if(o.list) {
@ -471,6 +469,9 @@ int main(int argc, char * argv[]) {
log_error << "cannot specify multiple actions";
return 0;
}
if(o.list) {
progress::set_enabled(false);
}
// Additional actions.
o.dump = options.count("dump");

4
src/util/console.cpp

@ -275,3 +275,7 @@ void progress::update(uint64_t delta, bool force) {
#endif
}
void progress::set_enabled(bool enable) {
show_progress = enable;
}

Loading…
Cancel
Save