From e7ba200143fb8ce2faf4757262994c6af63e42e9 Mon Sep 17 00:00:00 2001 From: hachti Date: Fri, 15 Jun 2007 12:46:04 +0000 Subject: [PATCH] Some small changes in configuration_manager output - added (c/f) info. Changed order in tool.hh:add_unique.... --- pc-tools/ldc2/src/configuration_manager.cpp | 56 ++++++++++++++------- pc-tools/ldc2/src/tool.hh | 10 ++-- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/pc-tools/ldc2/src/configuration_manager.cpp b/pc-tools/ldc2/src/configuration_manager.cpp index ea95bf8..98a3778 100644 --- a/pc-tools/ldc2/src/configuration_manager.cpp +++ b/pc-tools/ldc2/src/configuration_manager.cpp @@ -2,11 +2,15 @@ * * LDC2 source code * - * $Date: 2007/03/26 04:05:37 $ + * $Date: 2007/06/15 12:46:04 $ * $Author: hachti $ * * $Log: configuration_manager.cpp,v $ - * Revision 2.1 2007/03/26 04:05:37 hachti + * Revision 2.2 2007/06/15 12:46:04 hachti + * Some small changes in configuration_manager output - added (c/f) info. + * Changed order in tool.hh:add_unique.... + * + * Revision 2.1 2007-03-26 04:05:37 hachti * *** empty log message *** * * Revision 2.0 2007-03-26 01:00:38 hachti @@ -157,7 +161,8 @@ vector configuration_manager::read_args(int argc, char ** args){ string argstring; // Look for long parameters. - if ((argv[arg_no].substr(0,2)=="--")&&(free_parms_count==0)){ + // if ((argv[arg_no].substr(0,2)=="--")&&(free_parms_count==0)){ + if ((argv[arg_no].substr(0,2)=="--")){ // Changed for comfort. argstring=argv[arg_no].substr(2); // Look for long switches. @@ -202,7 +207,8 @@ vector configuration_manager::read_args(int argc, char ** args){ } // Look for short parameters - if ((argv[arg_no].substr(0,1)=="-")&&(free_parms_count==0)&&(!found)){ // Short parameters + // if ((argv[arg_no].substr(0,1)=="-")&&(free_parms_count==0)&&(!found)){ // Short parameters + if ((argv[arg_no].substr(0,1)=="-")&&(!found)){ // Changed for comfort. found=true; argstring=argv[arg_no].substr(1); // Reassign, with one more character now for (unsigned int pos=0;pos < argstring.length();pos++){ @@ -455,7 +461,12 @@ void configuration_manager::get_help(vector & target){ /* Now lets insert switches into left and right */ for (unsigned int sw=0; sw & target){ string nl(max_width,' '); nl.replace(0,left[c].length(),left[c]); nl+=" "+right[c]; - while (nl.length()>80){ // Too long??? - int limit=nl.find_last_of(' ',MAX_LINE_LENGTH+1); + while (nl.length()>MAX_LINE_LENGTH){ // Too long??? + int limit=nl.find_last_of(' ',MAX_LINE_LENGTH); target.insert(target.end(),nl.substr(0,limit)); - nl=string(max_width+2,' ')+nl.substr(limit+1); + nl=string(max_width+2+6,' ')+nl.substr(limit+1); } target.insert(target.end(),nl); } @@ -491,8 +502,14 @@ void configuration_manager::get_help(vector & target){ for (unsigned int val=0; val80){ // Too long??? - int limit=nl.find_last_of(' ',MAX_LINE_LENGTH+1); + string nl(max_width,' '); // Empty left side. + nl.replace(0,left[c].length(),left[c]); // Print in left side. + nl+=" "+right[c]; // Add right side. + + while (nl.length()>MAX_LINE_LENGTH){ // Too long??? + int limit=nl.find_last_of(' ',MAX_LINE_LENGTH); target.insert(target.end(),nl.substr(0,limit)); - nl=string(max_width+2,' ')+nl.substr(limit+1); + nl=string(max_width+2+6,' ')+nl.substr(limit+1); } target.insert(target.end(),nl); } } + target.insert(target.end(),""); + target.insert(target.end(),"Legend (c/f):"); + target.insert(target.end()," c: Allowed on command line."); + target.insert(target.end()," f: Allowed in configuration file."); + /* Output the Arguments */ if (cmd_args.size()){ target.insert(target.end(),""); @@ -541,7 +564,6 @@ void configuration_manager::get_help(vector & target){ nl+=" "+right[c]; while (nl.length()>MAX_LINE_LENGTH){ // Too long??? int limit=nl.find_last_of(' ',MAX_LINE_LENGTH+1); - // printf("limit:%i\n",limit); target.insert(target.end(),nl.substr(0,limit)); nl=string(max_width+2,' ')+nl.substr(limit+1); } diff --git a/pc-tools/ldc2/src/tool.hh b/pc-tools/ldc2/src/tool.hh index 1f5008b..5d3a7cc 100644 --- a/pc-tools/ldc2/src/tool.hh +++ b/pc-tools/ldc2/src/tool.hh @@ -2,11 +2,15 @@ * * LDC2 source code * - * $Date: 2007/05/30 02:51:16 $ + * $Date: 2007/06/15 12:46:04 $ * $Author: hachti $ * * $Log: tool.hh,v $ - * Revision 2.1 2007/05/30 02:51:16 hachti + * Revision 2.2 2007/06/15 12:46:04 hachti + * Some small changes in configuration_manager output - added (c/f) info. + * Changed order in tool.hh:add_unique.... + * + * Revision 2.1 2007-05-30 02:51:16 hachti * Changed everything towards LDC2 use. * Worked on the buildlib.sh. * Centralized buildlib.sh to a new lib/common directory. @@ -44,7 +48,7 @@ void merge_vector_unique(vector &target, const vector & source){ already_present=true; break; } - if (!already_present) target.insert(target.begin(),source[isource]); + if (!already_present) target.insert(target.end(),source[isource]); } } -- 2.32.0