summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-16 00:32:39 +0300
committerKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-16 00:32:39 +0300
commit31875e2d3b20a61e6d255dde9b6aad9feaa9a67d (patch)
treec9177776f2cb4df4e0deef5320424552390472c3 /tuiclient/tuiclient.cpp
parentAdd try...catch blocks to a few functions in request tool (diff)
downloadidfetch-31875e2d3b20a61e6d255dde9b6aad9feaa9a67d.tar.gz
idfetch-31875e2d3b20a61e6d255dde9b6aad9feaa9a67d.tar.bz2
idfetch-31875e2d3b20a61e6d255dde9b6aad9feaa9a67d.zip
Add show_help() function to tuiclient
Diffstat (limited to 'tuiclient/tuiclient.cpp')
-rw-r--r--tuiclient/tuiclient.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tuiclient/tuiclient.cpp b/tuiclient/tuiclient.cpp
index db99e73..0cac49d 100644
--- a/tuiclient/tuiclient.cpp
+++ b/tuiclient/tuiclient.cpp
@@ -275,6 +275,20 @@ void decode_log_msg(string msg_body){
void decode_error_log_msg(string msg_body){
mainwindow.error_log_win.add_line(msg_body);
}
+
+void show_help(){
+ try{
+ printout("Usage: tuiclient [OPTIONS]");
+ printout("Options:");
+ printout("--help Show this help.");
+ printout("--wait-distfiles=df_name1,df_name2,...,df_nameN Wait for specified distfiles to download and quit.");
+ printout("");
+ exit(0);
+ }catch(...){
+ printout("Error in request.cpp: show_help()");
+ }
+}
+
int parse_cli_arguments(int argc, char* argv[]){
try{
string option,name,value;
@@ -286,6 +300,10 @@ int parse_cli_arguments(int argc, char* argv[]){
posEqual=option.find('=');
name = trim(option.substr(0,posEqual));
value = trim(option.substr(posEqual+1));
+ if (name=="--help"){
+ show_help();
+ continue;
+ };
if (name=="--wait-distfiles"){
settings.arg_wait_distfiles=value;
settings.wait_distfiles_vector=split_to_vector(",", value);