Add "hide" to --download-result option

pull/641/head
Tatsuhiro Tsujikawa 2016-04-26 23:35:44 +09:00
parent 3c637fa3d5
commit aa863fa4d1
5 changed files with 11 additions and 7 deletions

View File

@ -315,7 +315,8 @@ error_code::Value MultiUrlRequestInfo::getResult()
if (!serverStatOf.empty()) {
e_->getRequestGroupMan()->saveServerStat(serverStatOf);
}
if (!option_->getAsBool(PREF_QUIET)) {
if (!option_->getAsBool(PREF_QUIET) &&
option_->get(PREF_DOWNLOAD_RESULT) != A2_V_HIDE) {
e_->getRequestGroupMan()->showDownloadResults(
*global::cout(), option_->get(PREF_DOWNLOAD_RESULT) == A2_V_FULL);
global::cout()->flush();

View File

@ -235,9 +235,9 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op);
}
{
OptionHandler* op(
new ParameterOptionHandler(PREF_DOWNLOAD_RESULT, TEXT_DOWNLOAD_RESULT,
A2_V_DEFAULT, {A2_V_DEFAULT, A2_V_FULL}));
OptionHandler* op(new ParameterOptionHandler(
PREF_DOWNLOAD_RESULT, TEXT_DOWNLOAD_RESULT, A2_V_DEFAULT,
{A2_V_DEFAULT, A2_V_FULL, A2_V_HIDE}));
op->addTag(TAG_ADVANCED);
op->setChangeGlobalOption(true);
handlers.push_back(op);

View File

@ -121,6 +121,7 @@ const std::string V_NONE("none");
const std::string V_MEM("mem");
const std::string V_ALL("all");
const std::string A2_V_FULL("full");
const std::string A2_V_HIDE("hide");
const std::string A2_V_GEOM("geom");
const std::string V_PREALLOC("prealloc");
const std::string V_FALLOC("falloc");
@ -336,7 +337,7 @@ PrefPtr PREF_STREAM_PIECE_SELECTOR = makePref("stream-piece-selector");
PrefPtr PREF_TRUNCATE_CONSOLE_READOUT = makePref("truncate-console-readout");
// value: true | false
PrefPtr PREF_PAUSE = makePref("pause");
// value: default | full
// value: default | full | hide
PrefPtr PREF_DOWNLOAD_RESULT = makePref("download-result");
// value: true | false
PrefPtr PREF_HASH_CHECK_ONLY = makePref("hash-check-only");

View File

@ -78,6 +78,7 @@ extern const std::string V_NONE;
extern const std::string V_MEM;
extern const std::string V_ALL;
extern const std::string A2_V_FULL;
extern const std::string A2_V_HIDE;
extern const std::string A2_V_GEOM;
extern const std::string V_PREALLOC;
extern const std::string V_FALLOC;
@ -289,7 +290,7 @@ extern PrefPtr PREF_STREAM_PIECE_SELECTOR;
extern PrefPtr PREF_TRUNCATE_CONSOLE_READOUT;
// value: true | false
extern PrefPtr PREF_PAUSE;
// value: default | full
// value: default | full | hide
extern PrefPtr PREF_DOWNLOAD_RESULT;
// value: true | false
extern PrefPtr PREF_HASH_CHECK_ONLY;

View File

@ -882,7 +882,8 @@
" download speed, percentage of progress and\n" \
" path/URI. The percentage of progress and\n" \
" path/URI are printed for each requested file in\n" \
" each row.")
" each row.\n" \
" If OPT is 'hide', \"Download Result\" is hidden.")
#define TEXT_HASH_CHECK_ONLY \
_(" --hash-check-only[=true|false] If true is given, after hash check using\n" \
" --check-integrity option, abort download whether\n" \