mirror of https://github.com/aria2/aria2
2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Print usage when no URL is specifed or bad command-line option is specified. * src/HelpItemFactory.cc * src/help_tags.h * src/option_processing.ccpull/1/head
parent
02b1062607
commit
d13b198ddd
|
@ -1,3 +1,11 @@
|
|||
2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Print usage when no URL is specifed or bad command-line option is
|
||||
specified.
|
||||
* src/HelpItemFactory.cc
|
||||
* src/help_tags.h
|
||||
* src/option_processing.cc
|
||||
|
||||
2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Removed duplicate log message.
|
||||
|
|
|
@ -473,8 +473,9 @@ TagContainerHandle HelpItemFactory::createHelpItems(const Option* op)
|
|||
{
|
||||
HelpItemHandle item(new HelpItem("help", TEXT_HELP, TAG_BASIC));
|
||||
item->setAvailableValues
|
||||
(StringFormat("%s,%s,%s,%s,%s,%s,all", TAG_BASIC, TAG_ADVANCED, TAG_HTTP, TAG_FTP, TAG_METALINK, TAG_BITTORRENT).str());
|
||||
(StringFormat("%s,%s,%s,%s,%s,%s,%s,all", TAG_BASIC, TAG_ADVANCED, TAG_HTTP, TAG_FTP, TAG_METALINK, TAG_BITTORRENT,TAG_HELP).str());
|
||||
item->addTag(TAG_BASIC);
|
||||
item->addTag(TAG_HELP);
|
||||
tc->addItem(item);
|
||||
}
|
||||
return tc;
|
||||
|
|
|
@ -41,5 +41,6 @@
|
|||
#define TAG_FTP "ftp"
|
||||
#define TAG_METALINK "metalink"
|
||||
#define TAG_BITTORRENT "bittorrent"
|
||||
#define TAG_HELP "help"
|
||||
|
||||
#endif // _D_HELP_TAGS_H_
|
||||
|
|
|
@ -517,6 +517,7 @@ Option* option_processing(int argc, char* const argv[])
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
default:
|
||||
showUsage(TAG_HELP, op);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
@ -549,6 +550,7 @@ Option* option_processing(int argc, char* const argv[])
|
|||
oparser.parse(op, cmdstream);
|
||||
} catch(Exception& e) {
|
||||
std::cerr << e.stackTrace() << std::endl;
|
||||
showUsage(TAG_HELP, op);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
@ -568,6 +570,7 @@ Option* option_processing(int argc, char* const argv[])
|
|||
!op->defined(PREF_INPUT_FILE)) {
|
||||
if(optind == argc) {
|
||||
std::cerr << MSG_URI_REQUIRED << std::endl;
|
||||
showUsage(TAG_HELP, op);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue