src/core/command-line.cc
changeset 3929 909b0a724ed3
parent 2972 d76553495b91
child 4490 6aa43c812fec
equal deleted inserted replaced
3928:c05de2ba481f 3929:909b0a724ed3
   251       std::cerr << "Invalid command-line arguments: --"<<name<<"="<<value<<std::endl;
   251       std::cerr << "Invalid command-line arguments: --"<<name<<"="<<value<<std::endl;
   252       PrintHelp ();
   252       PrintHelp ();
   253     }
   253     }
   254 }
   254 }
   255 
   255 
       
   256 bool
       
   257 CommandLine::CallbackItem::Parse (std::string value)
       
   258 {
       
   259   NS_LOG_DEBUG ("CommandLine::CallbackItem::Parse \"" << value << "\"");
       
   260   return m_callback (value);
       
   261 }
       
   262 
       
   263 void
       
   264 CommandLine::AddValue (const std::string &name,
       
   265                        const std::string &help,
       
   266                        Callback<bool, std::string> callback)
       
   267 {
       
   268   NS_LOG_FUNCTION (this << name << help << "callback");
       
   269   CallbackItem *item = new CallbackItem ();
       
   270   item->m_name = name;
       
   271   item->m_help = help;
       
   272   item->m_callback = callback;
       
   273   m_items.push_back (item);
       
   274 }
       
   275 
       
   276 
   256 } // namespace ns3
   277 } // namespace ns3
   257 
   278 
   258 #ifdef RUN_SELF_TESTS
   279 #ifdef RUN_SELF_TESTS
   259 
   280 
   260 #include "test.h"
   281 #include "test.h"