Changeset 1318
- Timestamp:
- Nov 27, 2010, 4:54:48 PM (12 years ago)
- Location:
- trunk/yat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/CommandLine.cc
r1240 r1318 1 // $Id: CommandLine.cc 23 47 2010-10-24 00:52:25Z peter $1 // $Id: CommandLine.cc 2351 2010-11-24 15:33:39Z peter $ 2 2 3 3 /* … … 204 204 205 205 206 std::vector<std::string> CommandLine::split(std::string str, char del) const207 {208 std::vector<std::string> vec;209 std::stringstream ss(str);210 while (std::getline(ss, str, del)){211 vec.push_back(str);212 }213 return vec;214 }215 216 206 std::string CommandLine::try_help(void) const 217 207 { -
trunk/yat/CommandLine.h
r1118 r1318 2 2 #define _theplu_yat_utility_commandline_ 3 3 4 //$Id: CommandLine.h 2 288 2010-06-28 02:05:31Z peter $4 //$Id: CommandLine.h 2351 2010-11-24 15:33:39Z peter $ 5 5 6 6 /* … … 190 190 bool is_long_option(std::string str) const; 191 191 bool is_short_option(std::string str) const; 192 std::vector<std::string> split(std::string str, char del) const;193 192 194 193 std::string description_; -
trunk/yat/OptionArg.h
r1039 r1318 2 2 #define _theplu_yat_utility_option_arg_ 3 3 4 // $Id: OptionArg.h 2 210 2010-03-05 22:59:01Z peter $4 // $Id: OptionArg.h 2352 2010-11-27 00:09:14Z peter $ 5 5 6 6 /* … … 147 147 catch (runtime_error& e) { 148 148 std::stringstream sstr(rhs); 149 sstr << ": invalid argument"; 149 sstr << "invalid argument"; 150 sstr << "`" << rhs << "' for `"; 151 if (!long_name().empty()) 152 sstr << "--" << long_name(); 153 else 154 sstr << "-" << short_name(); 155 sstr << "'"; 150 156 throw cmd_error(sstr.str()); 151 157 }
Note: See TracChangeset
for help on using the changeset viewer.